var DMap = DMap || {};
DMap.PRECISION = Math.pow(10, 6);
DMap.$ = jQuery.noConflict();


DMap.$get = function (a) {
  return DMap.$(document.getElementById(a));
};
DMap.$.fn.preventBubbles = function (a) {
  DMap.$(this).bind(a, function (b) {
    b.stopPropagation();
  });
};
DMap.$.fn.pngFix = function () {
  var a = DMap.$(this).get(0);
  var b = document.createElement('div');
  b.style.cssText = a.style.cssText;
  b.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + a.src + '", sizingMethod="crop")';
  a.parentNode.insertBefore(b, a);
  a.style.visibility = 'hidden';
  b.appendChild(a);
  b = null;
  a = null;
};
var needPngFix = DMap.$.browser.msie && (DMap.$.browser.version >= 5.5) && (DMap.$.browser.version < 7);
if (!needPngFix) {
  DMap.$.fn.pngFix = function () {
  };
}

// 检查浏览器版本
var DMap_browser = function () {
  if (DMap.$.browser.msie) {
    if (DMap.$.browser.version <= 6) {
      return 6;
    } else {
      if (DMap.$.browser.version == 7) {
        return 7;
      } else {
        if (DMap.$.browser.version == 8) {
          return 8;
        } else {
          if (DMap.$.browser.version == 9) {
            return 9;
          } else {
            if (DMap.$.browser.version == 10) {
              return 10;
            } else {
              if (DMap.$.browser.version == 11) {
                return 11;
              }
            }
          }
        }
      }
    }
  } else {
    if (DMap.$.browser.safari) {
      return 1;
    } else {
      if (DMap.$.browser.mozilla) {
        return 2;
      } else {
        if (DMap.$.browser.chrome) {
          return 3;
        } else {
          return 99;
        }
      }
    }
  }
}();

// 是否支持HTML5
var _isSouportHTML5 = function () {
  if (typeof(Worker) !== 'undefined') {
    return true;
  } else {
    return false;
  }
}();


// TODO 暂时取消这里的代码（重写 bind vue 会报错，hot 样式没有效果）
// Function.prototype.bind = function (b) {
//   var a = this;
//   return function () {
//     return a.apply(b, arguments);
//   };
// };


(function () {
  var d = '';
  var k = document.getElementsByTagName('head')[0];
  var h = new Date().getTime();
  var b = null;
  if (DCMapServer.GlobeParams.IpAddresses) {
    var l = DCMapServer.GlobeParams.IpAddresses.ipaddresses;
    for (var f = 0; f < l.length; f++) {
      if (l[f].address == m_ipaddress) {
        b = l[f].address;
      }
    }
    if (b != null) {
      for (var f = 0; f < DCMapServer.GlobeParams.MapSrcURL.mapTypes.length; f++) {
        var e = DCMapServer.GlobeParams.MapSrcURL.mapTypes[f][1].toString();
        var c = e.substring(e.indexOf('//') + 2, e.length);
        var m = c.substring(0, c.indexOf('/'));
        DCMapServer.GlobeParams.MapSrcURL.mapTypes[f][1] = e.replace(m, b);
        if (DCMapServer.GlobeParams.MapSrcURL.mapTypes[f][2]) {
          var g = DCMapServer.GlobeParams.MapSrcURL.mapTypes[f][2].toString();
          DCMapServer.GlobeParams.MapSrcURL.mapTypes[f][2] = g.replace(m, b);
        }
      }
    }
  }
  if (DCMapServer.GlobeParams.MapServices) {
    for (var f = 0; f < DCMapServer.GlobeParams.MapServices.mapServices.length; f++) {
      if (DCMapServer.GlobeParams.MapServices.mapServices[f].address && DCMapServer.GlobeParams.MapServices.mapServices[f].address != '') {
        var a = DCMapServer.GlobeParams.MapServices.mapServices[f].address + '?date=' + h;
        if (b != null) {
          a = a.replace(a.substring(a.indexOf('//') + 2, a.lastIndexOf(':')), b);
        }
        if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
          d += '<script charset=\'gbk\'  src=\'' + a + '\'><\/script>';
        } else {
          var j = document.createElement('script');
          j.src = a;
          k.appendChild(j);
        }
      }
    }
    if (d) {
      // console.log(d);
      // document.write(d);
    }
  }
})();


DMap.$.extend({
  toJSONString: function (a) {
    var d = typeof a;
    if (a == null) {
      return null;
    }
    if ('object' == d) {
      if (Array == a.constructor) {
        d = 'array';
      } else {
        if (RegExp == a.constructor) {
          d = 'regexp';
        } else {
          d = 'object';
        }
      }
    }
    switch (d) {
      case'undefined':
      case'unknown':
        return;
        break;
      case'function':
      case'boolean':
      case'regexp':
        return a.toString();
        break;
      case'number':
        return isFinite(a) ? a.toString() : 'null';
        break;
      case'string':
        return '"' + a.replace(/(\\|\")/g, '\\$1').replace(/\n|\r|\t/g, function () {
          var g = arguments[0];
          return (g == '\n') ? '\\n' : (g == '\r') ? '\\r' : (g == '\t') ? '\\t' : '';
        }) + '"';
        break;
      case'object':
        if (a === null) {
          return 'null';
        }
        var c = [];
        for (var f in a) {
          var e = jQuery.toJSONString(a[f]);
          if (e !== undefined) {
            c.push(jQuery.toJSONString(f) + ':' + e);
          }
        }
        return '{' + c.join(',') + '}';
        break;
      case'array':
        var c = [];
        for (var b = 0; b < a.length; b++) {
          var e = jQuery.toJSONString(a[b]);
          if (e !== undefined) {
            c.push(e);
          }
        }
        return '[' + c.join(',') + ']';
        break;
    }
  }
});
DMap.Lang = {
  code: null, defaultCode: 'zh_cn', getCode: function () {
    if (!DMap.Lang.code) {
      DMap.Lang.setCode();
    }
    return DMap.Lang.code;
  }, setCode: function (b) {
    var d;
    if (!b) {
      b = DMap.$.browser.msie ? navigator.userLanguage : navigator.language;
    }
    var c = b.split('-');
    c[0] = c[0].toLowerCase();
    if (typeof DMap.Lang[c[0]] == 'object') {
      d = c[0];
    }
    if (c[1]) {
      var a = c[0] + '-' + c[1].toUpperCase();
      if (typeof DMap.Lang[a] == 'object') {
        d = a;
      }
    }
    if (!d) {
      d = DMap.Lang.defaultCode;
    }
    DMap.Lang.code = d;
  }, translate: function (b, a) {
    var d = DMap.Lang[DMap.Lang.getCode()];
    var c = d[b];
    if (!c) {
      c = b;
    }
    if (a) {
      c = String.prototype.format(c, a);
    }
    return c;
  }
};
DMap.i18n = DMap.Lang.translate;
DMap.Class = function (e) {
  var b = function () {
    this.initialize.apply(this, arguments);
  };
  var a = {};
  var d;
  for (var c = 1; c < arguments.length; ++c) {
    if (typeof arguments[c] == 'function') {
      d = arguments[c].prototype;
    } else {
      d = arguments[c];
    }
    DMap.Util.extend(a, d);
  }
  DMap.Util.extend(a, {CLASS_NAME: e});
  b.prototype = a;
  DMap[e] = b;
};
DMap.Util = {
  mapCoordinateIndex: 0,
  lastSeqID: 0,
  removeNodeDiv: document.createElement('div'),
  removeNode: DMap.$.browser.msie ? function () {
    return function (a) {
      DMap.$(a).remove();
      if (a && a.tagName != 'BODY') {
        DMap.Util.removeNodeDiv.appendChild(a);
        DMap.Util.removeNodeDiv.innerHTML = '';
      }
    };
  }() : function (a) {
    DMap.$(a).remove();
  },
  buildTemplateStr: function (b, c) {
    for (var a in c) {
      b = b.replace(new RegExp('{' + a + '}', 'g'), c[a]);
    }
    return b;
  },
  getDomId: function (a) {
    if (a.id) {
    } else {
      a.id = DMap.Util.createUniqueID('DomLayer');
    }
    return a.id;
  },
  createUniqueID: function (a) {
    if (a == null) {
      a = 'DMap_Prefix_';
    }
    this.lastSeqID += 1;
    return a + this.lastSeqID;
  },
  createDiv: function (b, a) {
    b = b || {};
    a = a || {};
    var c = document.createElement('div');
    DMap.$(c).css(a).attr(b);
    return c;
  },
  createImgDiv: function (a, d, e, c) {
    var b = DMap.$('<img/>').css({width: a, height: d});
    if (c && !DMap.$.support('opacity')) {
      var f = DMap.$('<div/>');
      b.bind('onload', f, function (g) {
        var h = g.data;
        DMap.$(h).css({width: this.width, height: this.height, filter: ''});
      });
      b.src = e;
      return f;
    } else {
      return b;
    }
  },
  removeItem: function (c, b) {
    for (var a = c.length - 1; a >= 0; a--) {
      if (c[a] == b) {
        if (c.length == 1) {
          c.pop();
        } else {
          c.splice(a, 1);
        }
      }
    }
    return c;
  },
  extend: function (a, e) {
    if (a && e) {
      for (var d in e) {
        var c = e[d];
        if (c !== undefined) {
          a[d] = c;
        }
      }
      var b = typeof window.Event == 'function' && e instanceof window.Event;
      if (!b && e.hasOwnProperty && e.hasOwnProperty('toString')) {
        a.toString = e.toString;
      }
    }
    return a;
  },
  measureDistance: function (c) {
    var d = 0;
    if (DCMapServer.GlobeParams.MapProjection == 0) {
      for (var e = 1; e < c.length; e++) {
        var b = c[e - 1].lon;
        var j = c[e - 1].lat;
        var a = c[e].lon;
        var g = c[e].lat;
        var h = Math.abs(b - a);
        var f = Math.abs(j - g);
        h = h / DCMapServer.GlobeParams.MapCoordinateType;
        f = f / DCMapServer.GlobeParams.MapCoordinateType;
        d += Math.sqrt(h * h + f * f);
      }
      d = d / (360 / (2 * Math.PI * 6378137));
      d = Math.round(d * 100) / 100;
    } else {
      for (var e = 1; e < c.length; e++) {
        var b = c[e - 1].lon;
        var j = c[e - 1].lat;
        var a = c[e].lon;
        var g = c[e].lat;
        var h = Math.abs(b - a);
        var f = Math.abs(j - g);
        d += Math.sqrt(h * h + f * f);
      }
    }
    return d;
  },
  degToRad: function (a) {
    return (a / (360 / (2 * Math.PI)));
  },
  degreeToMeter: function (b) {
    var a = b / (360 / (2 * Math.PI * 6378137));
    a = Math.round(a * 100) / 100;
    return a;
  },
  getDegreeFromMeasure: function (a) {
    var b = a * (360 / (2 * Math.PI * 6378137));
    var c = b.toFixed(10);
    return c;
  },
  distanceFrom: function (f, e) {
    var j = [f.lat, e.lat];
    var l = [f.lon, e.lon];
    var b = 6378137;
    var h = (j[1] - j[0]) * Math.PI / 180;
    var k = (l[1] - l[0]) * Math.PI / 180;
    var m = Math.sin(h / 2) * Math.sin(h / 2) + Math.cos(j[0] * Math.PI / 180) * Math.cos(j[1] * Math.PI / 180) * Math.sin(k / 2) * Math.sin(k / 2);
    var i = 2 * Math.atan2(Math.sqrt(m), Math.sqrt(1 - m));
    var g = b * i;
    return Math.round(g * 10000) / 10000;
  },
  isContains: function (c, e) {
    var d = c || '';
    var b = DMap.$.trim(d.substring(0, d.indexOf('(')));
    var a = e || '';
    return this._isContains(d, b, a);
  },
  getLonLatBounds: function (b) {
    var c = b || '';
    var a = DMap.$.trim(c.substring(0, c.indexOf('(')));
    return this._getLonLatBounds(c, a);
  },
  _isContains: function (d, b, a) {
    if (b == 'POLYGON') {
      var e = this.polygonsStrToArray(d);
      return this.polygonsContains(e, a);
    }
    if (b == 'MULTIPOLYGON') {
      var c = this.multiPolygonsStrToArray(d);
      return this.multiPolygonsContains(c, a);
    } else {
      return false;
    }
  },
  _getLonLatBounds: function (e, a) {
    if (a == 'POLYGON' || a == 'LINESTRING') {
      var f = this.polygonsStrToArray(e);
      return this.getBoundsByPolygon(f);
    }
    if (a == 'MULTIPOLYGON') {
      var c = this.multiPolygonsStrToArray(e);
      return this.getBoundsByPolygonArray(c);
    }
    if (a == 'POINT') {
      var b = /^[^\d\.]*\(([\d\.]+)\s+([\d\.]+)\)/.exec(wkt);
      var d = new DMap.LonLat(b[1], b[2]);
      return DMap.LonLatBounds.fromLonLatArray([d]);
    }
  },
  getBoundsByPolygon: function (e) {
    var d = [];
    var a = 0;
    for (var c = 0; c < e.length; c++) {
      for (var b = 0; b < e[c].length; b++) {
        d[a++] = e[c][b];
      }
    }
    return DMap.LonLatBounds.fromLonLatArray(d);
  },
  getBoundsByPolygonArray: function (d) {
    var f = [];
    var b = 0;
    for (var e = 0; e < d.length; e++) {
      for (var c = 0; c < d[e].length; c++) {
        for (var a = 0; a < d[e][c].length; a++) {
          f[b++] = d[e][c][a];
        }
      }
    }
    return DMap.LonLatBounds.fromLonLatArray(f);
  },
  polygonStrToLonlatArray: function (e) {
    e = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')'));
    var d = [];
    var a = e.split(',');
    var b;
    for (var c = 0; c < a.length; c++) {
      b = (DMap.$.trim(a[c])).split(' ');
      d[c] = new DMap.LonLat(b[0], b[1]);
    }
    return d;
  },
  polygonsStrToArray: function (e) {
    e = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')'));
    var d = new RegExp('\\)\\s*[,]', 'g');
    e = e.replace(d, ');');
    var c = e.split(';');
    var b = new Array(c.length);
    for (var a = 0; a < c.length; a++) {
      b[a] = this.polygonStrToLonlatArray(c[a]);
    }
    return b;
  },
  multiPolygonsStrToArray: function (e) {
    e = e.substring(e.indexOf('(') + 1, e.lastIndexOf(')'));
    var d = new RegExp('\\)\\s*\\)\\s*[,]', 'g');
    e = e.replace(d, '));');
    var c = e.split(';');
    var a = new Array(c.length);
    for (var b = 0; b < c.length; b++) {
      a[b] = this.polygonsStrToArray(c[b]);
    }
    return a;
  },
  polygonContains: function (f, e) {
    var b = 0;
    var d = false;
    var a = e.lon;
    var g = e.lat;
    for (var c = 0; c < f.length; c++) {
      b++;
      if (b == f.length) {
        b = 0;
      }
      if (((f[c].lat < g) && (f[b].lat >= g)) || ((f[b].lat < g) && (f[c].lat >= g))) {
        if (f[c].lon + (g - f[c].lat) / (f[b].lat - f[c].lat) * (f[b].lon - f[c].lon) < a) {
          d = !d;
        }
      }
    }
    return d;
  },
  polygonsContains: function (e, c) {
    var d = this.polygonContains(e[0], c);
    var a = true;
    if (e.length > 0) {
      for (var b = 1; b < e.length; b++) {
        if (this.polygonContains(e[b], c)) {
          a = false;
        }
      }
    }
    return (d && a);
  },
  multiPolygonsContains: function (a, c) {
    for (var b = 0; b < a.length; b++) {
      if (this.polygonsContains(a[b], c)) {
        return true;
      }
    }
    return false;
  },
  getFeatureInPolygon: function (a, g) {
    var b = [];
    var f = a.getLonLats();
    for (var c = 0; c < g.length; c++) {
      var e = g[c];
      var d = e.getLonlat();
      if (DMap.Util.polygonContains(f, d)) {
        b.push(e);
      }
    }
    return b;
  },
  getNearestFeature: function (c, e) {
    var b = null;
    var a = Number.MAX_VALUE;
    var h = c.getLonlat();
    for (var f in e) {
      var g = e[f].getLonlat();
      var d = DMap.Util.measureDistance([h, g]);
      if (d < a) {
        a = d;
        b = e[f];
      }
    }
    return b;
  },
  expandArray: function (a, c) {
    for (var b = 0; b < c.length; b++) {
      if (c[b].constructor == Array) {
        this.expandArray(a, c[b]);
      } else {
        a[a.length] = c[b];
      }
    }
    return a;
  },
  createSVGDom: function (c, a) {
    var b = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    b.setAttribute('id', c);
    b.setAttribute('version', '1.1');
    b.setAttribute('overflow', 'visible');
    DMap.$(b).css({position: 'absolute', zIndex: a});
    return b;
  },
  quadrant: function (b, a) {
    if (a.lon > b.lon) {
      if (a.lat > b.lat) {
        return 1;
      } else {
        if (a.lat == b.lat) {
          return 5;
        } else {
          return 4;
        }
      }
    } else {
      if (a.lon == b.lon) {
        if (a.lat >= b.lat) {
          return 6;
        } else {
          return 7;
        }
      } else {
        if (a.lat > b.lat) {
          return 2;
        } else {
          if (a.lat == b.lat) {
            return 8;
          } else {
            return 3;
          }
        }
      }
    }
  },
  getLineKX: function (e, d) {
    var c, a;
    if (e.x != d.x) {
      c = (d.y - e.y) / (d.x - e.x);
      a = (e.x * d.y - d.x * e.y) / (e.x - d.x);
    } else {
      c = Infinity;
      a = e.x;
    }
    return [c, a];
  },
  getPointToLineDistance: function (b, c, f) {
    var e = new Array();
    if (b == Infinity) {
      e[0] = new DMap.Pixel(c.x + f, c.y);
      e[1] = new DMap.Pixel((c.x - f), c.y);
    } else {
      if (b == 0) {
        e[0] = new DMap.Pixel(c.x, (c.y + f));
        e[1] = new DMap.Pixel(c.x, (c.y - f));
      } else {
        var a = f * b * Math.sqrt(1 / (1 + b * b));
        var d = f * Math.sqrt(1 / (1 + b * b));
        e[0] = new DMap.Pixel((c.x - a), (c.y + d));
        e[1] = new DMap.Pixel((c.x + a), (c.y - d));
      }
    }
    return e;
  },
  pointToLinePosition: function (e, d, a) {
    var c;
    if (d == Infinity) {
      c = e.x - a;
    } else {
      c = e.y - (d * e.x + a);
    }
    return c;
  },
  getLinePoint: function (f, d, i, e, g) {
    var c;
    var a = e.x - i.x;
    var h = e.y - i.y;
    if (a == 0) {
      c = new DMap.Pixel(i.x, (i.y + h * g));
    } else {
      c = new DMap.Pixel((i.x + a * g), (i.y + h * g));
    }
    return c;
  },
  centerPoint: function (c, b) {
    var a = new DMap.Pixel((c.x + b.x) / 2, (c.y + b.y) / 2);
    return a;
  },
  pointDistance: function (b, a) {
    var c = Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));
    return c;
  },
  getPoint: function (f, c, g, a, e) {
    var d = [];
    var h;
    d = DMap.Util.getPointToLineDistance(g, c, 10);
    if (f == 1) {
      if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
        if (e) {
          h = d[0];
        } else {
          h = d[1];
        }
      } else {
        if (!e) {
          h = d[0];
        } else {
          h = d[1];
        }
      }
    } else {
      if (f == 2) {
        if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
          if (e) {
            h = d[0];
          } else {
            h = d[1];
          }
        } else {
          if (!e) {
            h = d[0];
          } else {
            h = d[1];
          }
        }
      } else {
        if (f == 3) {
          if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
            if (e) {
              h = d[0];
            } else {
              h = d[1];
            }
          } else {
            if (!e) {
              h = d[0];
            } else {
              h = d[1];
            }
          }
        } else {
          if (f == 4) {
            if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
              if (e) {
                h = d[0];
              } else {
                h = d[1];
              }
            } else {
              if (!e) {
                h = d[0];
              } else {
                h = d[1];
              }
            }
          } else {
            if (f == 5) {
              if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
                if (e) {
                  h = d[0];
                } else {
                  h = d[1];
                }
              } else {
                if (!e) {
                  h = d[0];
                } else {
                  h = d[1];
                }
              }
            } else {
              if (f == 8) {
                if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
                  if (e) {
                    h = d[0];
                  } else {
                    h = d[1];
                  }
                } else {
                  if (!e) {
                    h = d[0];
                  } else {
                    h = d[1];
                  }
                }
              } else {
                if (f == 6) {
                  if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
                    if (e) {
                      h = d[0];
                    } else {
                      h = d[1];
                    }
                  } else {
                    if (!e) {
                      h = d[0];
                    } else {
                      h = d[1];
                    }
                  }
                } else {
                  if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
                    if (e) {
                      h = d[0];
                    } else {
                      h = d[1];
                    }
                  } else {
                    if (!e) {
                      h = d[0];
                    } else {
                      h = d[1];
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    return h;
  },
  getLinePointDistPoints: function (d, a, f, e) {
    var g = new Array(2);
    if (d == Infinity) {
      g[0] = new DMap.Pixel(f.x, (f.y - e));
      g[1] = new DMap.Pixel(f.x, (f.y + e));
    } else {
      var h = Math.sqrt((e * e) / (1 + d * d));
      g[0] = new DMap.Pixel((f.x - h), (f.y - d * h));
      g[1] = new DMap.Pixel((f.x + h), (f.y + d * h));
    }
    return g;
  },
  getPoint_fire: function (e, c, f, a) {
    var d = [];
    var g;
    d = DMap.Util.getPointToLineDistance(f, c, 5);
    if (e == 1) {
      if (DMap.Util.pointToLinePosition(d[0], f, a) < 0) {
        g = d[0];
      } else {
        g = d[1];
      }
    } else {
      if (e == 2) {
        if (DMap.Util.pointToLinePosition(d[0], f, a) > 0) {
          g = d[0];
        } else {
          g = d[1];
        }
      } else {
        if (e == 3) {
          if (DMap.Util.pointToLinePosition(d[0], f, a) > 0) {
            g = d[0];
          } else {
            g = d[1];
          }
        } else {
          if (e == 4) {
            if (DMap.Util.pointToLinePosition(d[0], f, a) < 0) {
              g = d[0];
            } else {
              g = d[1];
            }
          } else {
            if (e == 5) {
              if (DMap.Util.pointToLinePosition(d[0], f, a) < 0) {
                g = d[0];
              } else {
                g = d[1];
              }
            } else {
              if (e == 8) {
                if (DMap.Util.pointToLinePosition(d[0], f, a) > 0) {
                  g = d[0];
                } else {
                  g = d[1];
                }
              } else {
                if (e == 6) {
                  if (DMap.Util.pointToLinePosition(d[0], f, a) > 0) {
                    g = d[0];
                  } else {
                    g = d[1];
                  }
                } else {
                  if (DMap.Util.pointToLinePosition(d[0], f, a) < 0) {
                    g = d[0];
                  } else {
                    g = d[1];
                  }
                }
              }
            }
          }
        }
      }
    }
    return g;
  },
  loadScript: function (b, d) {
    var c = document.getElementsByTagName('head')[0];
    var a = document.createElement('script');
    a.type = 'text/javascript';
    a.onreadystatechange = a.onload = function () {
      if (this.readyState == 'loaded' || this.readyState == 'complete') {
        this.onreadystatechange = this.onload = null;
        if (d) {
          d();
        }
      }
    };
    a.src = b;
    c.appendChild(a);
  },
  obj2str: function (c) {
    var b = [];
    if (typeof c == 'string' || c == null) {
      return '"' + c + '"';
    }
    if (typeof c == 'object') {
      if (!c.sort) {
        b[0] = '{';
        for (var a in c) {
          if (typeof c[a] == 'function') {
            continue;
          }
          b[b.length] = a;
          b[b.length] = ':';
          b[b.length] = this.obj2str(c[a]);
          b[b.length] = ',';
        }
        b[b.length - 1] = '}';
      } else {
        b[0] = '[';
        for (var a = 0; a < c.length; a++) {
          b[b.length] = this.obj2str(c[a]);
          b[b.length] = ',';
        }
        b[b.length - 1] = ']';
      }
      return b.join('');
    }
    return c.toString();
  },
  triangle: function (e, c, i) {
    var f = e.x;
    var m = e.y;
    var d = c.x;
    var l = c.y;
    var g = Math.atan((l - m) / (d - f));
    if (!i) {
      i = 60;
    }
    var h = g + i * Math.PI / 180;
    var j = Math.sqrt((l - m) * (l - m) + (d - f) * (d - f));
    if (j < 10) {
      return null;
    }
    var a = f + j * Math.cos(h);
    var k = m + j * Math.sin(h);
    var b = new DMap.Pixel(a, k);
    return b;
  }
};
(function () {
  var a = function (f, g) {
    var e = document.getElementsByTagName('HEAD')[0];
    var d = document.createElement('script');
    d.type = 'text/javascript';
    d.charset = 'utf-8';
    d.src = f;
    e.appendChild(d);
    if (g) {
      if (!window.ActiveXObject) {
        d.onload = function () {
          g();
        };
      } else {
        d.onreadystatechange = function () {
          if (d.readyState == 'loaded' || d.readyState == 'complete') {
            g();
          }
        };
      }
    }
  };
  if (DCMapServer.GlobeParams.Debug == true) {
    a(m_mapgis + '/firebug/js/firebug-lite.js', function () {
    });
  } else {
    // TODO 屏蔽掉(这里的代码会导致页面的console.log() 不能打印)
    // if (!window.console || !console.firebug) {
    //   var c = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
    //   window.console = {};
    //   for (var b = 0; b < c.length; ++b) {
    //     window.console[c[b]] = function () {
    //     };
    //   }
    // }
  }
})();
String.prototype.replaceAll = function (b, a) {
  return this.replace(new RegExp(b, 'gm'), a);
};
String.prototype.format = function (b, a) {
  return this.replace(/{([^{}]+)}/g, function (c, d) {
    return b[d] !== undefined ? b[d] : (!a ? c : null);
  });
};
DMap.MapBase = {
  _containerId: null,
  _viewportId: null,
  _panelContainerId: null,
  _panelPolygonId: null,
  _panelPolylineId: null,
  _panelMarkerId: null,
  _panelDrawId: null,
  _panelInfowindowId: null,
  _panelShadowInfowindowId: null,
  _zoom: null,
  _isLoaded: false,
  _isAnimateing: false,
  _dragObject: null,
  _mapTypeArray: null,
  _currentMapType: null,
  resolutions: null,
  _isScrollWheelZoom: true,
  _overlayArray: null,
  _controlArray: null,
  _toolbarHelper: null,
  _floatHelpOverlay: null,
  _infoWindowOverlay: null,
  _zoomChangeControl: null,
  _CopyrightControl: null,
  _OverviewMapControl: null,
  _ScaleControl: null,
  _MapTypeControl: null,
  _ZoomBarControl: null,
  _enableDragPan: true,
  _customEventClass: null,
  projection: null,
  resizethread: false,
  curMapBound: null,
  initialize: function (e, a) {
    DMap.EhlException.isTypeRight(DCMapServer.GlobeParams.MapSrcURL.mapTypes[0][1], 'undefined');
    if (DCMapServer.GlobeParams.MapSrcURL.mapTypes.length < 1) {
      throw DMap.Util.createError(gisapi.mapUrlError);
    }
    DMap.EhlException.isTypeRight(e, 'undefined');
    DMap.EhlException.isTypeRight(e, 'object');
    var o = DCMapServer.GlobeParams.MapSrcURL;
    a = DMap.$.extend(o, a || {});
    this.padding = {left: 0, top: 0, right: 0, bottom: 0};
    var g = a.mapTypes;
    this._mapTypeArray = new Array([g.length]);
    var n;
    for (var k = 0; k < g.length; k++) {
      n = '' + g[k] + '';
      n = n.split(',');
      var b = new Array();
      if (n.length > 2) {
        for (var f = 2; f < n.length; f++) {
          b.push(n[f]);
        }
      }
      this._mapTypeArray[k] = new DMap.MapType(n[1], n[0], b);
    }
    var d = {};
    var m = DCMapServer.GlobeParams.MapMaxLevel;
    var l = [];
    var c = DCMapServer.GlobeParams.MapResolution;
    if (DCMapServer.GlobeParams.bCustomResolution == 1) {
      l = new String(c).split(',');
    } else {
      for (var k = 0; k < m; k++) {
        l.push(c / Math.pow(2, k));
      }
    }
    d.resolutions = l;
    var h = DMap.$.extend(d);
    this.resolutions = h.resolutions;
    this._currentMapType = this._mapTypeArray[0];
    this._overlayArray = [];
    this._controlHash = {};
    this._customEventClass = '';
    this._floatHelpOverlay = null;
    this._initDiv(e);
    this._fixBrowser();
    this._initContainerEvent();
    this._initPanelContainerEvent();
    this.projection = new DMap.Projection(this.resolutions);
    this.setCenter();
  },
  _initDiv: function (d) {
    this._containerId = d.id;
    this._dom = DMap.$(['<table class="map-frame" cellpadding="0" cellspacing="0">', '<tr class="map-tbar-tr">', '<td><div class="map-tbar" id="toolbarss">&#160;</div></td>', '</tr>', '<tr>', '<td><div class="map-pane"><div class="map-viewport"></div></div></td>', '</tr>', '</table>'].join('')).get(0);
    this._viewportId = DMap.Util.createUniqueID('MapView');
    var b = DMap.$('.map-viewport', this._dom).get(0);
    b.setAttribute('id', this._viewportId);
    var a = DMap.$('.map-pane', this._dom).get(0);
    this._paneDom = a;
    this._panelContainerId = DMap.Util.createUniqueID('MapBase');
    var c = DMap.Util.createDiv({id: this._panelContainerId}, {
      position: 'absolute',
      left: '0px',
      top: '0px',
      zIndex: '0'
    });
    b.appendChild(c);
    d.appendChild(this._dom);
    this._panelPolygonId = DMap.Util.createUniqueID('PolygonLayer');
    if (DMap_browser >= 6 && DMap_browser < 10) {
      c.appendChild(DMap.Util.createDiv({id: this._panelPolygonId}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '102'
      }));
    } else {
      c.appendChild(DMap.Util.createSVGDom(this._panelPolygonId, '102'));
    }
    this._panelPolylineId = DMap.Util.createUniqueID('PolylineLayer');
    if (DMap_browser >= 6 && DMap_browser < 10) {
      c.appendChild(DMap.Util.createDiv({id: this._panelPolylineId}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    } else {
      c.appendChild(DMap.Util.createSVGDom(this._panelPolylineId, '103'));
    }
    this._panelMarkerId = DMap.Util.createUniqueID('MarkerLayer');
    c.appendChild(DMap.Util.createDiv({id: this._panelMarkerId}, {
      position: 'absolute',
      left: '0px',
      top: '0px',
      zIndex: '104'
    }));
    this._panelDrawId = DMap.Util.createUniqueID('DrawLayer');
    c.appendChild(DMap.Util.createDiv({id: this._panelDrawId}, {
      position: 'absolute',
      left: '0px',
      top: '0px',
      zIndex: '105'
    }));
    this._panelInfowindowId = DMap.Util.createUniqueID('InfoLayer');
    c.appendChild(DMap.Util.createDiv({id: this._panelInfowindowId}, {
      position: 'absolute',
      left: '0px',
      top: '0px',
      zIndex: '106',
      cursor: 'default'
    }));
    this._panelShadowInfowindowId = DMap.Util.createUniqueID('ShadowInfoLayer');
    c.appendChild(DMap.Util.createDiv({id: this._panelShadowInfowindowId}, {
      position: 'absolute',
      left: '0px',
      top: '0px',
      zIndex: '100'
    }));
    DMap.$get(this._panelInfowindowId).bind('mousedown', function (f) {
      f.stopPropagation();
    }).bind('mouseup', function (f) {
      f.stopPropagation();
    }).bind('contextmenu', function (f) {
      f.stopPropagation();
    }).bind('click', function (f) {
      f.stopPropagation();
    }).bind('dblclick', function (f) {
      f.stopPropagation();
    }).mousewheel(function (f) {
      f.stopPropagation();
    });
  },
  _setTopBarHeight: function (a) {
    if (a != 0) {
      if (DMap.$.browser.msie) {
        DMap.$('.map-tbar-tr', this._dom).css({height: a, display: 'block'});
      } else {
        DMap.$('.map-tbar-tr', this._dom).css({height: a, display: 'table-row'});
      }
    } else {
      DMap.$('.map-tbar-tr', this._dom).css('display', 'none');
    }
  },
  _getLeftPanelDom: function () {
    return DMap.$('.map-lpanel', this._dom).get(0);
  },
  _setLeftPanelWidth: function (a) {
    DMap.$('.map-lpanel', this._dom).css('width', a);
  },
  createResizeThread: function () {
    var b = this;
    var a = b.getZoom();
    b.resizethread = true;
    (function () {
      window.setTimeout(function () {
        if (b.curMapBound && !b.getBounds().equals(b.curMapBound) && a == b.getZoom()) {
          b.setCenter(b.curMapBound.midLonLat(), null);
          b.curMapBound = b.getBounds();
        }
        b.resizethread = false;
      }, 100);
    })();
  },
  _fixBrowser: function () {
    if (DMap.$.browser.msie) {
      DMap.$get(this._panelContainerId).bind('dragstart', function (a) {
        a.preventDefault();
      });
    }
  },
  _initContainerEvent: function () {
    var a = this;
    DMap.$get(this._viewportId).bind('contextmenu', function (c) {
      var b = a.fromMouseEventToLonLat(c);
      DMap.$(a).trigger('singlerightclick', [b, c.target, null]);
      DMap.$(a).trigger('contextmenu');
      return false;
    }).bind('mousedown', function (c) {
      var b = a.fromMouseEventToLonLat(c);
      DMap.$(a).trigger('mousedown', [b]);
    }).bind('mousemove', function (c) {
      var b = a.fromMouseEventToLonLat(c);
      DMap.$(a).trigger('mousemove', [b]);
    }).bind('mouseenter', function (c) {
      var b = a.fromMouseEventToLonLat(c);
      DMap.$(a).trigger('mouseover', [b]);
      return false;
    }).bind('mouseleave', function (c) {
      var b = a.fromMouseEventToLonLat(c);
      DMap.$(a).trigger('mouseout', [b]);
      return false;
    }).bind('resize', function (b) {
      if (a._isLoaded) {
        if (a.resizethread == false) {
          a.createResizeThread();
        }
      }
    });
  },
  _initPanelContainerEvent: function () {
    var a = this;
    this._dragObject = new DMap.DraggableObject(document.getElementById(this._panelContainerId), {handle: document.getElementById(a._viewportId)});
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        if (b) {
          DMap.$(a).trigger('click.' + a._customEventClass, [null, a.fromMouseEventToLonLat(b), null]);
        }
      }, mousedown: function () {
      }, dragstart: function () {
        a.stopAutoPan();
        a.setCursor('url(' + gisapi.getImageUrl('closedhand.cur') + '), default');
        if (a.checkBounds) {
          var m = a.getExtent();
          var l = a.fromLonLatToDivPixel(m.wn());
          var k = a.fromLonLatToDivPixel(m.es());
          var i = k.x - l.x;
          var d = k.y - l.y;
          var n = a.getSize();
          var g = a.fromLonLatToDivPixel(a.getCenter());
          var e = a.fromLonLatToDivPixel(a.getExtent().midLonLat());
          var c = parseInt(this.dom.style.left);
          var b = parseInt(this.dom.style.top);
          var j = c + g.x - e.x;
          var f = b + g.y - e.y;
          if (n.w > i) {
            this.minX = j;
            this.maxX = j;
          } else {
            this.minX = -l.x - i + n.w;
            this.maxX = -l.x;
          }
          if (n.h > d) {
            this.minY = f;
            this.maxY = f;
          } else {
            this.minY = -l.y - d + n.h;
            this.maxY = -l.y;
          }
        }
      }, drag: function (e, d, c, b) {
        if (a._enableDragPan) {
          a.setCursor('url(' + gisapi.getImageUrl('closedhand.cur') + '), default');
          this.moveTo(e, d);
        }
      }, dragend: function (b) {
        a.setCursor('url(' + gisapi.getImageUrl('openhand.cur') + '), default');
        DMap.$(a).trigger('moveend');
        DMap.$(a).trigger('dragend');
      }
    });
    DMap.$get(this._panelContainerId).dblclick(function (b) {
      DMap.$(a).trigger('dblclick.' + a._customEventClass, [null, a.fromMouseEventToLonLat(b)]);
    });
    DMap.$get(this._containerId).mousewheel(function (d, f) {
      d.stopPropagation();
      d.preventDefault();
      if (a.zooming) {
        return;
      }
      var c = a.fromMouseEventToLonLat(d);
      if (a._isScrollWheelZoom) {
        var b = -1;
        if (DMap.$.browser.opera) {
          if (f < 0) {
            f = 1;
          } else {
            f = -1;
          }
        }
        if (f > 0) {
          b = a.getZoom() + 1;
          a.activateFalshIn(c);
        } else {
          if (f < 0) {
            b = a.getZoom() - 1;
            a.activateFalshOut(c);
          }
        }
        a.setZoomByLonlat(c, b, true);
      }
      return false;
    });
  },
  destory: function () {
    if (this._dragObject) {
      this._dragObject.destory();
      this._dragObject = null;
    }
    if (this._floatHelpOverlay) {
      this._floatHelpOverlay.remove();
      this._floatHelpOverlay = null;
    }
    this.clearMapTypes();
    this.clearOverlays();
    this.clearControls();
    DMap.$(this).unbind();
    DMap.$('*', '#' + this._containerId).remove();
    DMap.$get(this._containerId).unbind();
    this._dom = null;
    this._paneDom = null;
  }
};
DMap.Class('DraggableObject', {
  oLeft: 0,
  oTop: 0,
  ox: 0,
  oy: 0,
  dragStarted: false,
  dom: null,
  iTimerID: null,
  _mouseUnselectable: null,
  _mouseDownEvent: null,
  initialize: function (d, b) {
    DMap.EhlException.isTypeRight(d, 'undefined');
    DMap.EhlException.isTypeRight(d, 'object');
    var a = this;
    b = b || {};
    this.dom = d;
    var c = b.handle || this.dom;
    a.handle = c;
    DMap.$(c).bind('mousedown.DraggableObject', function (f) {
      a._mouseDownEvent = f;
      if (f.which == 1) {
        DMap.DraggableObject.start(f, a);
      }
      return a.mousedown(f);
    }).bind('click.DraggableObject', function (f) {
      if (!a.dragStarted) {
        a.click(a._mouseDownEvent);
      }
      a._mouseDownEvent = null;
      return false;
    });
    if (DMap.$.browser.msie) {
      this._mouseUnselectable = DMap.$(d).attr('unselectable');
      DMap.$(c).attr('unselectable', 'on');
    } else {
      if (DMap.$.browser.safari) {
        DMap.$(d).css({'-webkit-user-select': 'none'});
      }
    }
  },
  mousedown: function () {
    return false;
  },
  click: function () {
  },
  dragstart: function () {
  },
  drag: function (b, a) {
    this.moveTo(b, a);
  },
  dragend: function (a) {
  },
  moveTo: function (a, e) {
    var d = this.dom.style;
    var c = parseInt(d.left);
    var b = parseInt(d.top);
    if (a < this.minX) {
      a = this.minX;
    }
    if (a > this.maxX) {
      a = this.maxX;
    }
    if (e < this.minY) {
      e = this.minY;
    }
    if (e > this.maxY) {
      e = this.maxY;
    }
    d.left = a + 'px';
    d.top = e + 'px';
  },
  moveBy: function (a, d, c) {
    var b = this.dom.style;
    if (c) {
      DMap.$(this.dom).animate({left: parseInt(b.left) + a + 'px', top: parseInt(b.top) + d + 'px'}, {
        easing: 'linear',
        complete: function () {
          c();
        }
      });
    } else {
      b.left = parseInt(b.left) + a + 'px';
      b.top = parseInt(b.top) + d + 'px';
    }
  },
  destory: function () {
    DMap.$(this.dom).unbind('.DraggableObject');
    this._mouseDownEvent = null;
    if (this.iTimerID) {
      window.clearTimeout(this.iTimerID);
      this.iTimerID = null;
    }
  },
  _mouseStart: function (a) {
    if (this.iTimerID) {
      window.clearTimeout(this.iTimerID);
      this.iTimerID = null;
    }
    this.dragStarted = true;
    this.dragstart();
  },
  _mouseDrag: function (c) {
    var a = this.dom.style;
    var d = this.oLeft + c.pageX - this.ox;
    var b = this.oTop + c.pageY - this.oy;
    this.drag(d, b);
  },
  _mouseStop: function (c) {
    var a = this;
    this.iTimerID = setTimeout(function () {
      a.dragStarted = false;
    }, 0);
    var d = this.oLeft + c.pageX - this.ox;
    var b = this.oTop + c.pageY - this.oy;
    this.dragend(new DMap.Pixel(d, b));
    (DMap.$.browser.msie && DMap.$(this.dom).attr('unselectable', this._mouseUnselectable));
  }
});
DMap.Util.extend(DMap.DraggableObject, {
  current: null,
  mouseDownEvent: null,
  dragStarted: false,
  start: function (c, b) {
    DMap.DraggableObject.current = b;
    var d = b.dom;
    b.oLeft = parseInt(d.style.left);
    b.oTop = parseInt(d.style.top);
    b.ox = c.pageX;
    b.oy = c.pageY;
    var a = b.handle;
    if (a.setCapture) {
      a.setCapture();
    }
    DMap.DraggableObject.mouseDownEvent = c;
    return false;
  },
  drag: function (a) {
    if (DMap.DraggableObject.current) {
      if (DMap.$.browser.msie && DMap.$.browser.version >= 10 || DMap.$.browser.mozilla) {
        a.button = 1;
      }
      if (DMap.$.browser.msie && !a.button) {
        return DMap.DraggableObject.stop(a);
      }
      if (DMap.DraggableObject.dragStarted) {
        DMap.DraggableObject.current._mouseDrag(a);
        return false;
      }
      if (DMap.DraggableObject.mouseDistanceMet(a)) {
        DMap.DraggableObject.dragStarted = true;
        DMap.DraggableObject.current._mouseStart(a);
      }
      return false;
    }
  },
  stop: function (b) {
    if (DMap.DraggableObject.current) {
      var a = DMap.DraggableObject.current.handle;
      if (a.releaseCapture) {
        a.releaseCapture();
      }
      if (DMap.DraggableObject.dragStarted) {
        DMap.DraggableObject.current._mouseStop(b);
      }
      DMap.DraggableObject.current = null;
      DMap.DraggableObject.dragStarted = false;
      DMap.DraggableObject.mouseDownEvent = null;
    }
  },
  mouseDistanceMet: function (a) {
    return (Math.max(Math.abs(DMap.DraggableObject.mouseDownEvent.screenX - a.screenX), Math.abs(DMap.DraggableObject.mouseDownEvent.screenY - a.screenY)) >= 3);
  }
});
if (DMap.$.browser.mozilla) {
  DMap.$(document).bind('mousemove.DraggableObject', DMap.DraggableObject.drag).bind('mouseup.DraggableObject', DMap.DraggableObject.stop);
  DMap.$(window).unload(function () {
  });
} else {
  DMap.$(document).bind('mousemove.DraggableObject', DMap.DraggableObject.drag).bind('mouseup.DraggableObject', DMap.DraggableObject.stop);
  DMap.$(window).unload(function () {
  });
}
(function (d) {
  var b = ['DOMMouseScroll', 'mousewheel'];
  if (d.event.fixHooks) {
    for (var a = b.length; a;) {
      d.event.fixHooks[b[--a]] = d.event.mouseHooks;
    }
  }
  d.event.special.mousewheel = {
    setup: function () {
      if (this.addEventListener) {
        for (var e = b.length; e;) {
          this.addEventListener(b[--e], c, false);
        }
      } else {
        this.onmousewheel = c;
      }
    }, teardown: function () {
      if (this.removeEventListener) {
        for (var e = b.length; e;) {
          this.removeEventListener(b[--e], c, false);
        }
      } else {
        this.onmousewheel = null;
      }
    }
  };
  d.fn.extend({
    mousewheel: function (e) {
      return e ? this.bind('mousewheel', e) : this.trigger('mousewheel');
    }, unmousewheel: function (e) {
      return this.unbind('mousewheel', e);
    }
  });

  function c(j) {
    var h = j || window.event, g = [].slice.call(arguments, 1), k = 0, i = true, f = 0, e = 0;
    j = d.event.fix(h);
    j.type = 'mousewheel';
    if (h.wheelDelta) {
      k = h.wheelDelta / 120;
    }
    if (h.detail) {
      k = -h.detail / 3;
    }
    e = k;
    if (h.axis !== undefined && h.axis === h.HORIZONTAL_AXIS) {
      e = 0;
      f = -1 * k;
    }
    if (h.wheelDeltaY !== undefined) {
      e = h.wheelDeltaY / 120;
    }
    if (h.wheelDeltaX !== undefined) {
      f = -1 * h.wheelDeltaX / 120;
    }
    g.unshift(j, k, f, e);
    return (d.event.dispatch || d.event.handle).apply(this, g);
  }
})(DMap.$);
var CODE_CENTER = 0;
var CODE_LEFT = 1;
var CODE_TOP = 1 << 1;
var CODE_RIGHT = 1 << 2;
var CODE_BOTTOM = 1 << 3;
var CODE_LEFT_TOP = CODE_LEFT | CODE_TOP;
var CODE_RIGHT_TOP = CODE_RIGHT | CODE_TOP;
var CODE_LEFT_BOTTOM = CODE_LEFT | CODE_BOTTOM;
var CODE_RIGHT_BOTTOM = CODE_RIGHT | CODE_BOTTOM;
DMap.Class('Bounds', {
  left: null, bottom: null, right: null, top: null, initialize: function (d, c, b, a) {
    if (d != null) {
      this.left = parseInt(d);
    }
    if (c != null) {
      this.top = parseInt(c);
    }
    if (b != null) {
      this.right = parseInt(b);
    }
    if (a != null) {
      this.bottom = parseInt(a);
    }
  }, toString: function () {
    return ('left-top=(' + this.left + ',' + this.top + ') right-bottom=(' + this.right + ',' + this.bottom + ')');
  }, containsPixel: function (b, a) {
    return this.contains(b.x, b.y, a);
  }, contains: function (b, d, a) {
    if (a == null) {
      a = true;
    }
    var c = false;
    if (a) {
      c = ((b >= this.left) && (b <= this.right) && (d >= this.top) && (d <= this.bottom));
    } else {
      c = ((b > this.left) && (b < this.right) && (d > this.top) && (d < this.bottom));
    }
    return c;
  }, _getRegionCode: function (b) {
    var a = CODE_CENTER;
    if (b.x < this.left) {
      a |= CODE_LEFT;
    }
    if (b.y < this.top) {
      a |= CODE_TOP;
    }
    if (b.x > this.right) {
      a |= CODE_RIGHT;
    }
    if (b.y > this.bottom) {
      a |= CODE_BOTTOM;
    }
    return a;
  }, intersectLine: function (e, b, h) {
    var g = this._getRegionCode(e);
    var d = this._getRegionCode(b);
    if (g & d) {
      if (!h) {
        return null;
      }
      switch (g | d) {
        case CODE_LEFT_TOP:
          return new DMap.Pixel(this.left, this.top);
        case CODE_RIGHT_TOP:
          return new DMap.Pixel(this.right, this.top);
        case CODE_LEFT_BOTTOM:
          return new DMap.Pixel(this.left, this.bottom);
        case CODE_RIGHT_BOTTOM:
          return new DMap.Pixel(this.right, this.bottom);
      }
    }
    if (g == CODE_CENTER && d == CODE_CENTER) {
      return [e, b];
    }
    var a = e.clone();
    var f = b.clone();
    var c = (b.y - e.y) / (b.x - e.x);
    switch (g) {
      case CODE_CENTER:
        break;
      case CODE_LEFT:
        a.x = this.left;
        a.y = e.y + (this.left - e.x) * c;
        break;
      case CODE_TOP:
        a.y = this.top;
        a.x = e.x + (this.top - e.y) / c;
        break;
      case CODE_RIGHT:
        a.x = this.right;
        a.y = e.y + (this.right - e.x) * c;
        break;
      case CODE_BOTTOM:
        a.y = this.bottom;
        a.x = e.x + (this.bottom - e.y) / c;
        break;
      case CODE_LEFT_TOP:
        a.y = this.top;
        a.x = e.x + (this.top - e.y) / c;
        if (a.x < this.left || a.x > this.right) {
          a.x = this.left;
          a.y = e.y + (this.left - e.x) * c;
        }
        break;
      case CODE_RIGHT_TOP:
        a.y = this.top;
        a.x = e.x + (this.top - e.y) / c;
        if (a.x < this.left || a.x > this.right) {
          a.x = this.right;
          a.y = e.y + (this.right - e.x) * c;
        }
        break;
      case CODE_LEFT_BOTTOM:
        a.y = this.bottom;
        a.x = e.x + (this.bottom - e.y) / c;
        if (a.x < this.left || a.x > this.right) {
          a.x = this.left;
          a.y = e.y + (this.left - e.x) * c;
        }
        break;
      case CODE_RIGHT_BOTTOM:
        a.y = this.bottom;
        a.x = e.x + (this.bottom - e.y) / c;
        if (a.x < this.left || a.x > this.right) {
          a.x = this.right;
          a.y = e.y + (this.right - e.x) * c;
        }
        break;
    }
    switch (d) {
      case CODE_CENTER:
        break;
      case CODE_LEFT:
        f.x = this.left;
        f.y = b.y + (this.left - b.x) * c;
        break;
      case CODE_TOP:
        f.y = this.top;
        f.x = b.x + (this.top - b.y) / c;
        break;
      case CODE_RIGHT:
        f.x = this.right;
        f.y = b.y + (this.right - b.x) * c;
        break;
      case CODE_BOTTOM:
        f.y = this.bottom;
        f.x = b.x + (this.bottom - b.y) / c;
        break;
      case CODE_LEFT_TOP:
        f.y = this.top;
        f.x = b.x + (this.top - b.y) / c;
        if (f.x < this.left || f.x > this.right) {
          f.x = this.left;
          f.y = b.y + (this.left - b.x) * c;
        }
        break;
      case CODE_RIGHT_TOP:
        f.y = this.top;
        f.x = b.x + (this.top - b.y) / c;
        if (f.x < this.left || f.x > this.right) {
          f.x = this.right;
          f.y = b.y + (this.right - b.x) * c;
        }
        break;
      case CODE_LEFT_BOTTOM:
        f.y = this.bottom;
        f.x = b.x + (this.bottom - b.y) / c;
        if (f.x < this.left || f.x > this.right) {
          f.x = this.left;
          f.y = b.y + (this.left - b.x) * c;
        }
        break;
      case CODE_RIGHT_BOTTOM:
        f.y = this.bottom;
        f.x = b.x + (this.bottom - b.y) / c;
        if (f.x < this.left || f.x > this.right) {
          f.x = this.right;
          f.y = b.y + (this.right - b.x) * c;
        }
        break;
    }
    a.x |= 0;
    a.y |= 0;
    f.x |= 0;
    f.y |= 0;
    return [a, f];
  }
});
DMap.Class('LonLat', {
  lon: 0, lat: 0, initialize: function (b, a) {
    this.lon = parseFloat(b);
    this.lat = parseFloat(a);
  }, midLonLat: function (a) {
    return new DMap.LonLat((this.lon + a.lon) / 2, (this.lat + a.lat) / 2);
  }, toString: function () {
    return this.lon + ',' + this.lat;
  }, equals: function (b) {
    var a = false;
    if (b != null) {
      a = ((this.lon == b.lon && this.lat == b.lat) || (isNaN(this.lon) && isNaN(this.lat) && isNaN(b.lon) && isNaN(b.lat)));
    }
    return a;
  }, clone: function () {
    return new DMap.LonLat(this.lon, this.lat);
  }, add: function (b, a) {
    DMap.EhlException._isNull(b);
    DMap.EhlException._isNull(a);
    return new DMap.LonLat(this.lon + b, this.lat + a);
  }
});
DMap.Class('LonLatSize', {
  w: 0, h: 0, initialize: function (a, b) {
    this.w = parseFloat(a);
    this.h = parseFloat(b);
  }, toString: function () {
    return ('w=' + this.w + ',h=' + this.h);
  }
});
DMap.Class('LonLatBounds', {
  initialize: function (d, a, b, c) {
    if (d > b) {
      this.left = b;
      this.right = d;
    } else {
      this.left = d;
      this.right = b;
    }
    if (c > a) {
      this.top = c;
      this.bottom = a;
    } else {
      this.top = a;
      this.bottom = c;
    }
  }, equals: function (a) {
    return a && a.left == this.left && a.right == this.right && a.top == this.top && a.bottom == this.bottom;
  }, midLonLat: function () {
    return new DMap.LonLat((this.left + this.right) / 2, (this.top + this.bottom) / 2);
  }, wn: function () {
    return new DMap.LonLat(this.left, this.top);
  }, es: function () {
    return new DMap.LonLat(this.right, this.bottom);
  }, toLonLatSize: function () {
    return new DMap.LonLatSize(this.w(), this.h());
  }, w: function () {
    return (this.right * DMap.PRECISION - this.left * DMap.PRECISION) / DMap.PRECISION;
  }, h: function () {
    return (this.top * DMap.PRECISION - this.bottom * DMap.PRECISION) / DMap.PRECISION;
  }, toString: function () {
    return ('left-bottom=(' + this.left + ',' + this.bottom + ') right-top=(' + this.right + ',' + this.top + ')');
  }, toBBOX: function (a) {
    var b = Math.round(this.left * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(this.bottom * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(this.right * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(this.top * DMap.PRECISION) / DMap.PRECISION;
    return b;
  }, contains: function (c, a) {
    if (a == null) {
      a = true;
    }
    var b = false;
    if (a) {
      b = ((c.lon >= this.left) && (c.lon <= this.right) && (c.lat >= this.bottom) && (c.lat <= this.top));
    } else {
      b = ((c.lon > this.left) && (c.lon < this.right) && (c.lat > this.bottom) && (c.lat < this.top));
    }
    return b;
  }, containsBounds: function (e, d, b) {
    if (d == null) {
      d = false;
    }
    if (b == null) {
      b = true;
    }
    var c;
    var g;
    var a;
    var f;
    if (b) {
      c = (e.left >= this.left) && (e.left <= this.right);
      g = (e.top >= this.bottom) && (e.top <= this.top);
      a = (e.right >= this.left) && (e.right <= this.right);
      f = (e.bottom >= this.bottom) && (e.bottom <= this.top);
    } else {
      c = (e.left > this.left) && (e.left < this.right);
      g = (e.top > this.bottom) && (e.top < this.top);
      a = (e.right > this.left) && (e.right < this.right);
      f = (e.bottom > this.bottom) && (e.bottom < this.top);
    }
    return (d) ? (g || f) && (c || a) : (g && c && f && a);
  }, intersectsBounds: function (d, b) {
    if (b == null) {
      b = true;
    }
    var f = (d.bottom == this.bottom && d.top == this.top) ? true : (((d.bottom > this.bottom) && (d.bottom < this.top)) || ((this.bottom > d.bottom) && (this.bottom < d.top)));
    var e = (d.bottom == this.bottom && d.top == this.top) ? true : (((d.top > this.bottom) && (d.top < this.top)) || ((this.top > d.bottom) && (this.top < d.top)));
    var a = (d.right == this.right && d.left == this.left) ? true : (((d.right > this.left) && (d.right < this.right)) || ((this.right > d.left) && (this.right < d.right)));
    var c = (d.right == this.right && d.left == this.left) ? true : (((d.left > this.left) && (d.left < this.right)) || ((this.left > d.left) && (this.left < d.right)));
    return (this.containsBounds(d, true, b) || d.containsBounds(this, true, b) || ((e || f) && (c || a)));
  }
});
DMap.LonLatBounds.fromLonLatArray = function (f) {
  var b = f[0].lon;
  var g = f[0].lon;
  var a = f[0].lat;
  var e = f[0].lat;
  for (var d = 1, c = f.length; d < c; d++) {
    if (f[d].lon < b) {
      b = f[d].lon;
    }
    if (f[d].lon > g) {
      g = f[d].lon;
    }
    if (f[d].lat < a) {
      a = f[d].lat;
    }
    if (f[d].lat > e) {
      e = f[d].lat;
    }
  }
  return new DMap.LonLatBounds(b, a, g, e);
};
DMap.Class('Pixel', {
  x: 0, y: 0, initialize: function (a, b) {
    this.x = parseInt(a);
    this.y = parseInt(b);
  }, clone: function () {
    return new DMap.Pixel(this.x, this.y);
  }, toString: function () {
    return ('x=' + this.x + ',y=' + this.y);
  }, add: function (a, b) {
    DMap.EhlException._isNull(a);
    DMap.EhlException._isNull(b);
    return new DMap.Pixel(this.x + a, this.y + b);
  }
});
DMap.Class('Projection', {
  resolutions: null,
  controlPointLonLat: null,
  controlPointPixel: null,
  initialize: function (a) {
    DMap.EhlException._isNull(a);
    this.resolutions = a;
  },
  setControlPoint: function (b, a) {
    DMap.EhlException.isTypeRight(b, 'undefined');
    DMap.EhlException._isNull(b);
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(b, 'DMap.LonLat');
    DMap.EhlException.isTypeRight(a, 'DMap.Pixel');
    this.controlPointLonLat = b;
    this.controlPointPixel = a;
  },
  fromLonLatToDivPixel: function (c, b) {
    var a = 0;
    var d = 0;
    if (c == undefined) {
    } else {
      DMap.EhlException._isNull(c);
      DMap.EhlException._isNull(b);
      DMap.EhlException.isTypeRight(b, 'number');
      a = (c.lon - this.controlPointLonLat.lon) * DMap.PRECISION / (this.resolutions[b] * DMap.PRECISION * DCMapServer.GlobeParams.MapCoordinateType);
      d = (this.controlPointLonLat.lat - c.lat) * DMap.PRECISION / (this.resolutions[b] * DMap.PRECISION * DCMapServer.GlobeParams.MapCoordinateType);
    }
    return this.controlPointPixel.add(Math.round(a), Math.round(d));
  },
  fromDivPixelToLonLat: function (b, c) {
    DMap.EhlException._isNull(b);
    DMap.EhlException._isNull(c);
    DMap.EhlException.isTypeRight(b, 'DMap.Pixel');
    DMap.EhlException.isTypeRight(c, 'number');
    var a = Math.round(this.resolutions[c] * DMap.PRECISION * (b.x - this.controlPointPixel.x)) / DMap.PRECISION * DCMapServer.GlobeParams.MapCoordinateType;
    var d = Math.round(this.resolutions[c] * DMap.PRECISION * (this.controlPointPixel.y - b.y)) / DMap.PRECISION * DCMapServer.GlobeParams.MapCoordinateType;
    return this.controlPointLonLat.add(a, d);
  }
});
DMap.Class('Size', {
  w: 0, h: 0, initialize: function (a, b) {
    this.w = parseInt(a);
    this.h = parseInt(b);
  }, toString: function () {
    return ('w=' + this.w + ',h=' + this.h);
  }, equals: function (a) {
    var b = false;
    if (a != null) {
      b = (this.w == a.w && this.h == a.h);
    }
    return b;
  }, clone: function () {
    return new DMap.Size(this.w, this.h);
  }
});
DMap.Class('TilesRange', {
  minRow: null, minCol: null, maxRow: null, maxCol: null, initialize: function (a, c, d, b) {
    this.minRow = parseInt(a);
    this.minCol = parseInt(c);
    this.maxRow = parseInt(d);
    this.maxCol = parseInt(b);
  }, add: function (d) {
    var a, e, c, b;
    if (d.minRow < this.minRow) {
      a = d.minRow;
      e = this.maxRow;
    } else {
      a = this.minRow;
      e = d.maxRow;
    }
    if (d.minCol < this.minCol) {
      c = d.minCol;
      b = this.maxCol;
    } else {
      c = this.minCol;
      b = d.maxCol;
    }
    return new DMap.TilesRange(a, c, e, b);
  }, contains: function (b) {
    var a = b[0];
    var c = b[1];
    return (a >= this.minRow && a <= this.maxRow && c >= this.minCol && c <= this.maxCol);
  }, equals: function (a) {
    return (this.minRow == a.minRow && this.minCol == a.minCol && this.maxRow == a.maxRow && this.maxCol == a.maxCol);
  }, toString: function () {
    return ('minRow=' + this.minRow + ',minCol=' + this.minCol + ',maxRow=' + this.maxRow + ',maxCol=' + this.maxCol);
  }
});
DMap.Class('Control', {
  initialize: function () {
  }, draw: function (a) {
  }, remove: function () {
  }
});
DMap.Class('Overlay', {
  _minZoom: null, _maxZoom: null, _visible: true, _zIndex: null, initialize: function () {
  }, draw: function (a) {
  }, redraw: function (a) {
  }, remove: function () {
  }, copy: function () {
  }, refresh: function () {
  }, getDoms: function () {
    alert('need implements getDoms!!!');
  }, hide: function (a) {
    if (!a || (a && this._visible)) {
      DMap.$(this).trigger('visibilitychanged', [false]);
      DMap.$(this.getDoms()).css('display', 'none');
    }
    if (!a) {
      this._visible = false;
    }
  }, show: function (a) {
    if (!(a && !this._visible)) {
      DMap.$(this).trigger('visibilitychanged', [true]);
      DMap.$(this.getDoms()).css('display', 'block');
    }
    if (!a) {
      this._visible = true;
    }
  }, isHidden: function () {
    return !this._visible;
  }, isShow: function () {
    if (this._minZoom != null && this._maxZoom != null) {
      if (this._map.getZoom() >= this._minZoom && this._map.getZoom() <= this._maxZoom) {
        this.show(false);
        return true;
      } else {
        this.hide(false);
        return false;
      }
    }
    return true;
  }, setZIndex: function (a) {
    if (this.getDoms() != null) {
      this._zIndex = a;
      DMap.$(this.getDoms()).css('z-index', a);
    }
  }, getZIndex: function () {
    return DMap.$(this.getDoms()).css('z-index');
  }, setMinZoom: function (a) {
    this._minZoom = a;
    return this;
  }, setMaxZoom: function (a) {
    this._maxZoom = a;
    return this;
  }, getWktStr: function () {
  }
});
DMap.Overlay.getZIndex = function (a) {
  if (DCMapServer.GlobeParams.MapProjection == 1) {
    a = a / 20037508.342789244;
  } else {
    if (DCMapServer.GlobeParams.MapProjection == 3) {
      a = a / new Number(new String((DCMapServer.GlobeParams.MapInitCenter)).split(',')[1]);
    }
  }
  return '-' + Math.ceil((a + 90) * DMap.PRECISION);
};

function wkt2lonlatArray(wkt) {
  var hash = [];
  wkt = wkt.replace(/^\s*\w+\s*\(/, '(').replace(/\(\s*([\d\s,.]+)\s*\)/g, function (m, p1) {
    var a = p1.split(/\s*,\s*/g);
    for (var i = 0; i < a.length; i++) {
      var ll = a[i];
      ll = ll.split(/\s/g);
      a[i] = new DMap.LonLat(ll[0], ll[1]);
    }
    return 'hash[' + (hash.push(a) - 1) + ']';
  });
  wkt = wkt.replace(/\(/g, '[').replace(/\)/g, ']');
  hash = eval(wkt);
  return hash;
}

function lonlatArray2bounds(b) {
  var a = [];
  a = DMap.Util.expandArray(a, b);
  return DMap.LonLatBounds.fromLonLatArray(a);
}

DMap.Util.wkt2lonlatArray = wkt2lonlatArray;
DMap.Util.lonlatArray2bounds = lonlatArray2bounds;
DMap.Overlay.createByWKT = function (f, g, a) {
  DMap.EhlException._isNull(f);
  DMap.EhlException.isTypeRight(f, 'string');
  var e = /^\s*(\w+)\s*\(/;
  var d;
  if (e.test(f)) {
    var c = RegExp.$1.toUpperCase();
    switch (c) {
      case'POINT':
        d = DMap.Util.wkt2lonlatArray(f);
        var b = new DMap.Marker(d[0], g, a);
        b.gType = 'POINT';
        b.wktStr = f;
        b.getWktStr = function () {
          return this.wktStr;
        };
        return b;
      case'LINESTRING':
        d = DMap.Util.wkt2lonlatArray(f);
        var b = new DMap.Polyline(d, g, a);
        b.gType = 'LINESTRING';
        b.wktStr = f;
        b.getWktStr = function () {
          return this.wktStr;
        };
        return b;
      case'POLYGON':
        d = DMap.Util.wkt2lonlatArray(f);
        var b = new DMap.Polygon(d, g, a);
        b.gType = 'POLYGON';
        b.wktStr = f;
        b.getWktStr = function () {
          return this.wktStr;
        };
        return b;
      case'MULTIPOLYGON':
        d = DMap.Util.wkt2lonlatArray(f);
        var b = new DMap.MultiPolygon(d, g, a);
        b.gType = 'MULTIPOLYGON';
        b.wktStr = f;
        b.getWktStr = function () {
          return this.wktStr;
        };
        return b;
      case'MULTILINESTRING':
        d = DMap.Util.wkt2lonlatArray(f);
        var b = new DMap.MultiLineString(d, g, a);
        b.gType = c;
        b.wktStr = f;
        b.getWktStr = function () {
          return this.wktStr;
        };
        return b;
      case'MULTIPOINT':
        d = DMap.Util.wkt2lonlatArray(f);
        var b = new DMap.MultiPoint(d, g, a);
        b.gType = c;
        b.wktStr = f;
        b.getWktStr = function () {
          return this.wktStr;
        };
        return b;
    }
  } else {
    throw'bad wkt format!';
  }
};
DMap.Overlay.clone = function (a) {
  return DMap[a.CLASS_NAME].clone(a);
};
DMap.Class('ColorWindow', {
  _colorAry: [['FFFFFF', 'CCCCCC', 'C0C0C0', '999999', '666666', '333333', '000000'], ['FFCCCC', 'FF6666', 'FF0000', 'CC0000', '990000', '660000', '330000'], ['FFCC99', 'FF9966', 'FF9900', 'FF6600', 'CC0000', '993300', '663300'], ['FFFF99', 'FFFF66', 'FFCC66', 'FFCC33', 'CC9933', '996633', '663333'], ['FFFFCC', 'FFFF33', 'FFFF00', 'FFCC00', '999900', '666600', '333300'], ['99FF99', '66FF99', '33FF33', '33CC00', '009900', '006600', '003300'], ['99FFFF', '33FFFF', '66CCCC', '00CCCC', '339999', '336666', '003333'], ['CCFFFF', '66FFFF', '33CCFF', '3366FF', '3333FF', '000099', '000066'], ['CCCCFF', '9999FF', '6666CC', '6633FF', '6600CC', '333399', '330099'], ['FFCCFF', 'FF99FF', 'CC66CC', 'CC33CC', '993399', '663366', '330033']],
  _left: null,
  _top: null,
  _colorObj: null,
  initialize: function (a) {
    a = a || {};
    this._left = a.left || 100;
    this._top = a.top || 100;
    this._colorDiv = null;
    this.createDiv();
    _colorObj = this;
  },
  createDiv: function () {
    var f = this;
    this._colorDiv = document.createElement('div');
    var e = '<div id="color_div" style="left:' + this._left + ';top:' + this._top + ';background:#BBBBBB;padding:1px;z-INDEX:11" onmouseleave="_colorObj.hide();" >';
    var a = '<table><thead>';
    for (var d = 0; d < this._colorAry.length; d++) {
      var c = this._colorAry[d];
      a += '<tr height=9>';
      for (var b = 0; b < c.length; b++) {
        a += '<td width=8 style=\'background:#' + c[b] + '\' onclick=\'_colorObj.chooseColor("' + c[b] + '")\'>';
        a += '<div></div></td>';
      }
      a += '</tr>';
    }
    a += '</thead><TBODY></TBODY></table>';
    e += a;
    e += '</div>';
    this._colorDiv.innerHTML = e;
    DMap.$(this._colorDiv).css({left: this._left, top: this._top, 'z-index': '11', position: 'absolute'});
  },
  chooseColor: function (a) {
    this._callBack.call(this, a);
    this.hide();
  },
  reset: function (b, a) {
    this._left = b;
    this._top = a;
    document.getElementById('color_div').style.left = this._left;
    document.getElementById('color_div').style.top = this._top;
  },
  getDiv: function () {
    return DMap.$(this._colorDiv).get(0);
  },
  show: function (b, a) {
    if (!b) {
      b = function () {
      };
    }
    this._callBack = b;
    document.getElementById('map').appendChild(this._colorDiv);
    document.getElementById('color_div').style.display = 'block';
  },
  hide: function () {
    DMap.$(this._colorDiv).children('div')[0].style.display = 'none';
    try {
      document.getElementById('color_div').style.display = 'none';
    } catch (a) {
    }
  }
});
DMap.ShapeHelper = {
  _openlayersCheckPixelArray: function (e, f) {
    f = f || 15000;
    var c = [];
    var a = e.length;
    for (var d = 0, b = a; d < b; d++) {
      if (this._isValidSvgPixel(e[d], f)) {
        c.push(e[d]);
      } else {
        if (d > 0) {
          if (this._isValidSvgPixel(e[d - 1], f)) {
            c.push(this._openlayersClipLine(e[d], e[d - 1], f));
          }
        }
        if (d < a - 1) {
          if (this._isValidSvgPixel(e[d + 1], f)) {
            c.push(this._openlayersClipLine(e[d], e[d + 1], f));
          }
        }
      }
    }
    return c;
  }, _isValidSvgPixel: function (a, b) {
    return (a.x >= -b && a.x <= b && a.y >= -b && a.y <= b);
  }, _openlayersClipLine: function (f, c, h) {
    var d = c.x;
    var g = c.y;
    var b = f.x;
    var e = f.y;
    var a;
    if (b < -h || b > h) {
      a = (e - g) / (b - d);
      b = b < 0 ? -h : h;
      e = g + (b - d) * a;
    }
    if (e < -h || e > h) {
      a = (b - d) / (e - g);
      e = e < 0 ? -h : h;
      b = d + (e - g) * a;
    }
    return new DMap.Pixel(b, e);
  }
};
if (document.createStyleSheet) {
  var st = document.createStyleSheet();
  if (document.namespaces && !document.namespaces.v) {
    document.namespaces.add('v', 'urn:schemas-microsoft-com:vml');
  }
  var shapes = ['shape', 'rect', 'oval', 'fill', 'stroke', 'imagedata', 'group'];
  for (var i = 0, len = shapes.length; i < len; i++) {
    st.addRule('v\\:' + shapes[i], 'behavior: url(#default#VML); position: absolute; display: inline-block;');
  }
}

function pathclip(g, f) {
  var b = [];
  var e, a;
  if (g.length > 1) {
    var h = false;
    e = g[0];
    a = g[g.length - 1];
    if (e.x == a.x && e.y == a.y) {
      h = true;
    }
    for (var d = 0; d < g.length - 1; d++) {
      e = g[d];
      a = g[d + 1];
      var c = f.intersectLine(e, a, h);
      if (c != null) {
        if (c.length == 2) {
          if (!b.length || (c[0].x != b[b.length - 1].x || c[0].y != b[b.length - 1].y)) {
            b.push(c[0]);
          }
          if (b[0].x != c[1].x || b[0].y != c[1].y) {
            b.push(c[1]);
          }
        } else {
          b.push(c);
        }
      }
    }
    if (h && b.length) {
      b.push(b[0].clone());
    }
    return b;
  } else {
    return g;
  }
};

/**
 * 覆盖点
 */
DMap.Class('Marker', DMap.Overlay, {
  _lonlat: null,
  _attributes: null,
  _offsetSize: null,
  _dom: null,
  _labelDom: null,
  _map: null,
  _dragObject: null,
  isAdded: false,
  _timer: null,
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException.isTypeRight(c, 'DMap.LonLat');
    this.symbol = {
      type: 0,
      size: new DMap.Size(32, 32),
      offsetType: 'mm',
      url: gisapi.getMarkerImageUrl('dragmarker.gif'),
      animateUrl: gisapi.getMarkerImageUrl('dragmarker_blink.gif'),
      borderWidth: 1,
      borderColor: '#FF0000',
      color: '#FFFFFF',
      markTextColor: '#000000',
      opacity: 0.6,
      text: gisapi.title_text,
      textFontSize: 12,
      textBorderColor: '#FF0000',
      textBackgroundColor: '#015190',
      textColor: '#FFFFFF',
      labelText: null,
      markText: null,
      markTextFontSize: 12,
      labelFontSize: 12,
      labelBorderColor: '#FF0000',
      labelBackgroundColor: '#015190',
      labelColor: '#FFFFFF'
    };
    this._attributes = DMap.$.extend({}, a);
    this.symbol = DMap.$.extend(this.symbol, b);
    this.setLonlat(c);
    this._dom = DMap.Marker.createDom(this.symbol);
    DMap.Marker.setDomSymbol(this._dom, this.symbol);
    this._offsetSize = DMap.Marker.getOffset(this.symbol);
    if (this.symbol.labelText) {
      this._labelDom = DMap.Marker.createLabelDom(this.symbol);
    }
  },
  getType: function () {
    return this.symbol.type;
  },
  setType: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.type = a;
    this.setSymbol(this.symbol);
  },
  getSize: function () {
    return this.symbol.size;
  },
  setSize: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'DMap.Size');
    this.symbol.size = a;
    this.setSymbol(this.symbol);
  },
  setOffsetType: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.offsetType = a;
    this.setSymbol(this.symbol);
  },
  getOffsetType: function () {
    return this.symbol.offsetType;
  },
  setUrl: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.url = a;
    this.setSymbol(this.symbol);
  },
  getUrl: function () {
    return this.symbol.url;
  },
  setAnimateUrl: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(_url, 'string');
    this.symbol.animateUrl = a;
    this.setSymbol(this.symbol);
  },
  getAnimateUrl: function () {
    return this.symbol.animateUrl;
  },
  getBorderWidth: function () {
    return this.symbol.borderWidth;
  },
  setBorderWidth: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.borderWidth = a;
    this.setSymbol(this.symbol);
  },
  setBorderColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.borderColor = a;
    this.setSymbol(this.symbol);
  },
  getBorderColor: function () {
    return this.symbol.borderColor;
  },
  setColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.color = a;
    this.setSymbol(this.symbol);
  },
  getColor: function () {
    return this.symbol.color;
  },
  getOpacity: function () {
    return this.symbol.opacity;
  },
  setText: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.text = a;
    this.setSymbol(this.symbol);
  },
  getText: function () {
    return this.symbol.text;
  },
  setTextFontSize: function (a) {
    DMap.EhlException._isNull(a);
    this.symbol.textFontSize = a;
    this.setSymbol(this.symbol);
  },
  getTextFontSize: function () {
    return this.symbol.textFontSize;
  },
  setTextBackgroundColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.textBackgroundColor = a;
    this.setSymbol(this.symbol);
  },
  getTextBackgroundColor: function () {
    return this.symbol.textBackgroundColor;
  },
  setTextColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.textColor = a;
  },
  getTextColor: function () {
    return this.symbol.textColor;
  },
  setLabelText: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelText = a;
    this.setSymbol(this.symbol);
  },
  getLabelText: function () {
    return this.symbol.labelText;
  },
  setLabelFontSize: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.labelFontSize = a;
    this.setSymbol(this.symbol);
  },
  getLabelFontSize: function () {
    return this.symbol.labelFontSize;
  },
  setLabelBorderColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelBorderColor = a;
    this.setSymbol(this.symbol);
  },
  getLabelBorderColor: function () {
    return this.symbol.labelBorderColor;
  },
  setLabelBackgroundColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelBackgroundColor = a;
    this.setSymbol(this.symbol);
  },
  getLabelBackgroundColor: function () {
    return this.symbol.labelBackgroundColor;
  },
  setLabelColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelColor = a;
    this.setSymbol(this.symbol);
  },
  getLabelColor: function () {
    return this.symbol.labelColor;
  },
  addAnimate: function (d, a) {
    var e;
    var b = this.symbol.size;
    var c = this.symbol.url;
    this.setCommonEvent();
    DMap.$(this).bind('mouseover.ainimate', function () {
      var f = this;
      e = setInterval(function () {
        if (f.symbol.url != f.symbol.animateUrl) {
          f.setSymbol({type: 0, url: d.animateUrl, size: d.size});
        } else {
          f.setSymbol({type: 0, url: c, size: f.symbol.size});
        }
      }, a);
    });
    DMap.$(this).bind('mouseout.ainimate', function () {
      clearInterval(e);
      this.setSymbol({type: 0, url: c, size: b});
    });
  },
  removeAnimate: function () {
    DMap.$(this).unbind('.ainimate');
  },
  flash: function (a) {
    var b = this;
    this._timer = setInterval(function () {
      DMap.$(b._dom).fadeOut(500).fadeIn(500);
    }, a || 1000);
  },
  clearFlash: function () {
    if (this._timer) {
      clearInterval(this._timer);
      this._timer = null;
    }
  },
  setAttributes: function (a) {
    this._attributes = DMap.$.extend(this._attributes, a);
  },
  getAttributes: function () {
    return DMap.$.extend({}, this._attributes);
  },
  getSymbol: function () {
    return DMap.$.extend({}, this.symbol);
  },
  setSymbol: function (a) {
    this.symbol = DMap.$.extend(this.symbol, a);
    if (typeof(a.size) != 'undefined') {
      this.symbol.size = a.size;
    }
    DMap.Marker.setDomSymbol(this._dom, this.symbol);
    if (this._labelDom) {
      DMap.Marker.setLabelDomSymbol(this._labelDom, this.symbol);
    }
    this._offsetSize = DMap.Marker.getOffset(this.symbol);
    if (this._map) {
      this.moveToLonlat();
    }
  },
  setLonlat: function (a) {
    this._lonlat = a;
  },
  getLonlat: function () {
    return this._lonlat.clone();
  },
  getDoms: function () {
    return [this._dom, this._labelDom];
  },
  draw: function (a) {
    this._map = a;
    if (this._labelDom) {
      document.getElementById(a._panelMarkerId).appendChild(this._labelDom);
    }
    document.getElementById(a._panelMarkerId).appendChild(this._dom);
    this.moveToLonlat();
  },
  redraw: function (a) {
    if (a) {
      this.moveToLonlat();
    }
  },
  remove: function () {
    if (this._dom == null) {
      return;
    }
    DMap.$(this).trigger('clear');
    if (this._dragObject) {
      this._dragObject.destory();
    }
    this._dragObject = null;
    this.clearEvent();
    DMap.$(this).unbind();
    DMap.$(this._dom).unbind();
    var a = document.getElementById('orphanContainer');
    if (!a) {
      a = document.createElement('div');
      a.id = 'orphanContainer';
      a.style.display = 'none';
      document.body.appendChild(a);
    }
    a.appendChild(this._dom);
    a.innerHTML = '';
    this._lonlat = null;
    this._offsetSize = null;
    this._dom = null;
    this._map = null;
    if (this._labelDom) {
      DMap.$(this._labelDom).remove();
      this._labelDom = null;
    }
    if (this.clearMove) {
      this.clearMove();
    }
  },
  copy: function () {
    return new DMap.Marker(this.getLonlat(), this.getSymbol(), this.getAttributes());
  },
  moveToLonlat: function (c) {
    var b = this;
    try {
      if (!this.isShow()) {
        return;
      }
      if (c) {
        this._lonlat = c;
      }
      if (this._lonlat) {
        if (this._lonlat.lat <= -90) {
          this._dom.style.zIndex = this._zIndex || DMap.Overlay.getZIndex(-89);
        } else {
          this._dom.style.zIndex = this._zIndex || DMap.Overlay.getZIndex(this._lonlat.lat);
        }
        var a = this.fromLonlatToDomPixel(this._lonlat);
        this._dom.style.left = (a.x) + 'px';
        this._dom.style.top = (a.y) + 'px';
        if (this._labelDom) {
          this._labelDom.style.zIndex = this._dom.style.zIndex;
          this._labelDom.style.left = (this.symbol.size.w + parseInt(this._dom.style.left) + 2) + 'px';
          this._labelDom.style.top = (parseInt(this._dom.style.top) - (DMap.$(this._labelDom).outerHeight() - this.symbol.size.h) / 2) + 'px';
        }
      }
    } catch (d) {
      throw DMap.EhlException.createError(gisapi.lonlatError, d);
    }
  },
  moveToPixel: function (a) {
    a = a.add(this._offsetSize.w, this._offsetSize.h);
    this.moveToLonlat(this._map.fromDivPixelToLonLat(a));
  },
  fromLonlatToDomPixel: function (b) {
    var a = this._map.fromLonLatToDivPixel(b);
    return a.add(-this._offsetSize.w, -this._offsetSize.h);
  },
  rotate: function (d, c) {
    var a = DMap.Util.degToRad(d);
    costheta = Math.cos(a);
    sintheta = Math.sin(a);
    if (!c) {
      c = this._dom;
    }
    if (c) {
      // TODO 暂时屏蔽，不然会报错（Unhandled promise rejection TypeError: Cannot set property 'filter' of undefined）
      // c.style.filter = 'progid:DXImageTransform.Microsoft.Matrix()';
      // c.filters.item('DXImageTransform.Microsoft.Matrix').SizingMethod = 'auto expand';
      // c.filters.item('DXImageTransform.Microsoft.Matrix').FilterType = 'bilinear';
      // c.filters.item('DXImageTransform.Microsoft.Matrix').M11 = costheta;
      // c.filters.item('DXImageTransform.Microsoft.Matrix').M12 = -sintheta;
      // c.filters.item('DXImageTransform.Microsoft.Matrix').M21 = sintheta;
      // c.filters.item('DXImageTransform.Microsoft.Matrix').M22 = costheta;
    }
  },
  setOpacity: function (a) {
    var b = /^(0([\.]\d*[0-9]+)|0|1)$/;
    if (!b.test(a)) {
      alert(gisapi.validateNumber);
      return;
    }
    DMap.$(this._dom).css('opacity', a);
    return this;
  },
  clearEvent: function () {
    if (this._dragObject) {
      this._dragObject.destory();
    }
    DMap.$(this._dom).unbind().css('cursor', '');
    if (this._labelDom) {
      DMap.$(this._labelDom).unbind().css('cursor', '');
    }
    return this;
  },
  _setLabelEvent: function () {
    var a = this;
    if (this._labelDom) {
      DMap.$(this._labelDom).bind('mousedown', function () {
        return false;
      }).bind('mouseenter', function (b) {
        DMap.$(a).trigger('mouseover');
        return false;
      }).bind('mouseleave', function (b) {
        DMap.$(a).trigger('mouseout');
        return false;
      }).bind('click', function (b) {
        DMap.$(a).trigger('click');
        return false;
      }).css('cursor', 'pointer');
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    DMap.$(a._dom).bind('mousedown', function () {
      return false;
    }).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('click', function (b) {
      DMap.$(a).trigger('click');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    this._setLabelEvent();
    return this;
  },
  setDragEvent: function () {
    var a = this;
    a.clearEvent();
    this._dom.style.zIndex = DMap.Overlay.getZIndex(-89);
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click');
      }, dragstart: function () {
        DMap.$(a).trigger('dragstart');
      }, drag: function (c, b) {
        a.moveToPixel(new DMap.Pixel(c, b));
        DMap.$(a).trigger('drag');
      }, dragend: function (b) {
        a.moveToPixel(b);
        DMap.$(a).trigger('dragend');
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).css('cursor', 'default');
    this._setLabelEvent();
    return this;
  },
  openInfoWindowHtml: function (b, a) {
    a = DMap.$.extend({
      offsetSize: new DMap.Size(this.symbol.size.w - this._offsetSize.w, this._offsetSize.h + 3),
      marker: this
    }, a);
    this._map.openInfoWindowHtml(this.getLonlat(), b, a);
  },
  openInfoWindow: function (b, a) {
    a = DMap.$.extend({
      offsetSize: new DMap.Size(this.symbol.size.w - this._offsetSize.w, this._offsetSize.h + 3),
      marker: this
    }, a);
    this._map.openInfoWindow(this.getLonlat(), b, a);
  },
  attention: function (c, b) {
    if (c === undefined) {
      c = 1;
    }
    if (c <= 0) {
      return;
    }
    b = Math.min(1000, b || 1000);
    var a = this;
    (function () {
      a._map.activateFalshOut(a._lonlat);
      c = c - 1;
      if (c > 0) {
        setTimeout(arguments.callee, b);
      }
    })();
  },
  enableEditing: function () {
    this.setDragEvent();
  },
  disableEditing: function () {
    this.clearEvent();
    this._map.deactivate();
  }
});
DMap.Marker.clone = function (a) {
  return new DMap.Marker(a._lonlat, a.symbol, a._attributes);
};
DMap.Marker.printable = true;
DMap.Marker.getOffset = function (c) {
  var b = c.offsetType;
  var a = c.size;
  switch (b) {
    case'lt':
      return new DMap.Size(0, 0);
    case'lm':
      return new DMap.Size(0, a.h / 2);
    case'lb':
      return new DMap.Size(0, a.h);
    case'mt':
      return new DMap.Size(a.w / 2, 0);
    case'mm':
      return new DMap.Size(a.w / 2, a.h / 2);
    case'mb':
      return new DMap.Size(a.w / 2, a.h);
    case'rt':
      return new DMap.Size(a.w, 0);
    case'rm':
      return new DMap.Size(a.w, a.h / 2);
    case'rb':
      return new DMap.Size(a.w, a.h);
    default:
      return new DMap.Size(0, 0);
  }
};
DMap.Marker.STYLE_PICTURE = 0;
DMap.Marker.STYLE_SQUARE = 1;
DMap.Marker.STYLE_CIRCLE = 2;
DMap.Marker.setDomSymbol = function (c, b) {
  switch (b.type) {
    case 0:
      var a = b.url;
      if (needPngFix && (a.toUpperCase().indexOf('.PNG') > 0)) {
        DMap.$(c.firstChild).css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=\'' + a + '\')'});
      } else {
        DMap.$(c).attr('src', a);
      }
      DMap.$(c).css({
        position: 'absolute',
        border: '0px none',
        margin: '0px',
        padding: '0px',
        width: b.size.w + 'px',
        height: b.size.h + 'px',
        left: '10000px',
        top: '10000px'
      });
      break;
    case 1:
      DMap.$(c).css({
        position: 'absolute',
        border: b.borderWidth + 'px solid ' + b.borderColor,
        width: (b.size.w - 2 * b.borderWidth) + 'px',
        height: (b.size.h - 2 * b.borderWidth) + 'px',
        fontSize: '1%'
      });
      if (b.color) {
        DMap.$(c).css({backgroundColor: b.color});
      }
      if (b.opacity) {
        DMap.$(c).css({opacity: b.opacity});
      }
      if (!DMap.$.boxModel) {
        DMap.$(c).css({width: b.size.w + 'px', height: b.size.h + 'px'});
      }
      break;
    case 2:
      b.size.w = DMap.Marker.textToSum(b.text) * b.textFontSize + 4;
      b.size.h = b.textFontSize + 4;
      DMap.$(c).css({
        position: 'absolute',
        border: '1px solid ' + b.textBorderColor,
        padding: '1px solid',
        backgroundColor: b.textBackgroundColor,
        fontSize: b.textFontSize + 'px',
        color: b.textColor,
        width: (b.size.w - 2) + 'px',
        height: (b.size.h - 2) + 'px'
      });
      DMap.$(c).text(b.text);
      if (!DMap.$.boxModel) {
        DMap.$(c).css({width: b.size.w + 'px', height: b.size.h + 'px'});
      }
      break;
    case 3:
      var a = b.url;
      if (needPngFix && (a.toUpperCase().indexOf('.PNG') > 0)) {
        DMap.$(c.firstChild).css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=\'' + a + '\')'});
      }
      DMap.$(c).css({
        position: 'absolute',
        border: '0px none',
        margin: '0px',
        padding: '0px',
        width: b.size.w + 'px',
        height: b.size.h + 'px',
        'text-align': 'center',
        'line-height': b.size.h + 'px',
        background: 'url(' + a + ') no-repeat center center ',
        left: '10000px',
        top: '10000px'
      });
      if (b.markText) {
        if (!b.markTextFontSize) {
          b.markTextFontSize = 12;
        }
        DMap.$(c).css({
          'text-align': 'center',
          color: b.markTextColor,
          'font-size': b.markTextFontSize,
          'font-weight': 'blob'
        });
        DMap.$(c).html(b.markText);
      }
      break;
    default:
      DMap.$(c).css({
        position: 'absolute',
        border: '1px solid rgb(255, 0, 0)',
        width: (b.size.w - 1) + 'px',
        height: (b.size.h - 1) + 'px',
        fontSize: '1%'
      });
      if (b.color) {
        DMap.$(c).css({backgroundColor: b.color});
      }
  }
};
DMap.Marker.setLabelDomSymbol = function (c, b) {
  var a = DMap.Marker.textToSum(b.labelText) * b.labelFontSize;
  DMap.$(c).css({
    position: 'absolute',
    border: '1px solid ' + b.labelBorderColor,
    padding: '1px solid',
    backgroundColor: b.labelBackgroundColor,
    fontSize: b.labelFontSize + 'px',
    color: b.labelColor,
    height: (b.labelFontSize + 2) + 'px',
    width: (a + 2) + 'px'
  });
  if (!DMap.$.boxModel) {
    DMap.$(c).css({width: (a + 4) + 'px', height: (b.labelFontSize) + 'px'});
  }
  DMap.$(c).html(b.labelText);
};
DMap.Marker.createDom = function (b) {
  var c = null;
  switch (b.type) {
    case 0:
      var a = b.url;
      if (needPngFix && (a.toUpperCase().indexOf('.PNG') > 0)) {
        c = DMap.$('<div style=""><div style="height:100%;width:100%;"></div>').get(0);
      } else {
        c = document.createElement('img');
      }
      break;
    case 1:
      c = document.createElement('div');
      break;
    case 2:
      c = document.createElement('div');
      break;
    case 3:
      c = DMap.$('<div style=""><div style="height:100%;width:100%;"></div>').get(0);
      break;
    default:
      c = document.createElement('div');
  }
  return c;
};
DMap.Marker.createLabelDom = function (b) {
  var c = document.createElement('div');
  var a = DMap.Marker.textToSum(b.labelText) * b.labelFontSize;
  DMap.$(c).css({
    position: 'absolute',
    border: '1px solid ' + b.labelBorderColor,
    padding: '1px solid',
    backgroundColor: b.labelBackgroundColor,
    fontSize: b.labelFontSize + 'px',
    color: b.labelColor,
    height: (b.labelFontSize + 2) + 'px',
    width: (a + 2) + 'px'
  });
  if (!DMap.$.boxModel) {
    DMap.$(c).css({width: (a + 4) + 'px', height: (b.labelFontSize) + 'px'});
  }
  DMap.$(c).text(b.labelText);
  return c;
};
DMap.Marker.textToSum = function (f) {
  var e = /[^\u4e00-\u9fa5]/;
  var a = 0;
  for (var c = 0, b = f.length; c < b; c++) {
    var d = f.charAt(c);
    if (e.test(d)) {
      a += 1;
    } else {
      a += 2;
    }
  }
  return Math.ceil(a / 2);
};
DMap.Class('MoveMarker', DMap.Marker, {
  _jQueryObject: null,
  _moveLonlatArray: null,
  _moveIndex: null,
  _isPause: null,
  _allTime: 20000,
  _repeat: false,
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException.isTypeRight(c, 'DMap.LonLat');
    DMap.Marker.prototype.initialize.apply(this, arguments);
    this._jQueryObject = DMap.$(this._dom);
    this._moveLonlatArray = null;
    this._isPause = false;
  },
  draw: function () {
    DMap.Marker.prototype.draw.apply(this, arguments);
    if (!this._forOverview) {
      this._dom.style.display = 'none';
    }
  },
  redraw: function (a) {
    DMap.Marker.prototype.redraw.apply(this, arguments);
    if (a && this._moveLonlatArray && this._moveIndex != null) {
      if (this._isPause) {
      } else {
        this._jQueryObject.stop(true, false);
        this.moveToLonlat(this.getLonlat());
        this._regeditAnimate();
      }
    }
  },
  _regeditOneAnimate: function (e, d, c, a) {
    var b = this;
    this._jQueryObject.animate({left: e + 'px', top: d + 'px'}, {
      duration: c,
      easing: !this._forOverview ? 'linear' : 'swing',
      complete: function () {
        b._moveIndex = a;
        if (a == b._moveLonlatArray.length - 1) {
          DMap.$(b).trigger('moveend', [b._moveLonlatArray[a]]);
          if (b._repeat) {
            window.setTimeout(function () {
              b._jQueryObject.stop(true, false);
              b._moveIndex = 0;
              var f = b.fromLonlatToDomPixel(b._moveLonlatArray[0]);
              b.moveToPixel(f);
              b._regeditAnimate();
            }, 2000);
          }
        } else {
          DMap.$(b).trigger('movestep', [b._moveLonlatArray[a]]);
        }
      },
      step: function () {
        b.moveToPixel(new DMap.Pixel(b._dom.style.left, b._dom.style.top));
        DMap.$(b).trigger('move', [b.getLonlat()]);
      },
      queue: true
    });
  },
  _regeditAnimate: function () {
    var f = 20000;
    var a = DMap.Util.measureDistance(this._moveLonlatArray);
    this._isPause = false;
    for (var e = this._moveIndex + 1, d = this._moveLonlatArray.length; e < d; e++) {
      var c = this.fromLonlatToDomPixel(this._moveLonlatArray[e]);
      var b = DMap.Util.measureDistance([this._moveLonlatArray[e - 1], this._moveLonlatArray[e]]);
      if (b == 0) {
        b = 1;
      }
      this._regeditOneAnimate(c.x, c.y, b / a * this._allTime, e);
    }
  },
  startMove: function (a, b) {
    this._allTime = b || 10000;
    this.clearMove();
    this.moveToLonlat(a[0]);
    DMap.$(this).trigger('movestart', [a[0]]);
    this._dom.style.display = 'block';
    this._moveLonlatArray = a;
    this._moveIndex = 0;
    this._regeditAnimate();
  },
  pauseMove: function () {
    if (this._isPause != null && this._isPause == false) {
      this._jQueryObject.stop(true, false);
      this._isPause = true;
    }
  },
  continueMove: function () {
    if (this._isPause) {
      this._regeditAnimate();
      this._isPause = false;
    }
  },
  clearMove: function () {
    this.hide();
    this._jQueryObject.stop(true, false);
    this._isPause = null;
    this._moveLonlatArray = null;
    this._moveIndex = null;
  },
  _setForOverview: function (a) {
    this._forOverview = a;
  },
  setRepeat: function (a) {
    this._repeat = a;
  }
});
DMap.Class('Polyline', DMap.Overlay, {
  _map: null,
  _dom: null,
  _isAnimate: true,
  isAnimate: false,
  _outRingLonlats: null,
  _innerRingLonlatsArray: null,
  _attributes: null,
  _isEditing: null,
  _editMarkerArray: null,
  _editPolyline1: null,
  _editPolyline2: null,
  _name: null,
  _description: null,
  initialize: function (g, d, a) {
    try {
      this.parmLonlats = g;
      this._innerRingLonlatsArray = [];
      if (g) {
        if (g.length == 0 || g[0].midLonLat) {
          this._outRingLonlats = g;
        } else {
          for (var c = 0, b = g.length; c < b; c++) {
            if (c == 0) {
              this._outRingLonlats = g[0];
            } else {
              this._innerRingLonlatsArray.push(g[c]);
            }
          }
        }
      } else {
        this._outRingLonlats = [];
      }
      this.symbol = {
        color: '#FF0000',
        animateColor: '#FFFFFF',
        animateFromColor: '#FF0000',
        weight: 2,
        opacity: 1,
        dashstyle: 'solid',
        fillColor: '#0000FF',
        fillColor2: '#0000FF',
        fillOpacity: 0.5,
        fillType: 'solid',
        startarrow: 'none',
        startarrowwidth: 'medium',
        startarrowlength: 'medium',
        endarrow: 'none',
        endarrowwidth: 'medium',
        endarrowlength: 'medium'
      };
      this._attributes = DMap.$.extend({}, a);
      this.symbol = DMap.$.extend(this.symbol, d);
      this._editMarkerArray = [];
      this._dom = this._createDom();
      this.setSymbol();
    } catch (f) {
      throw DMap.EhlException.createError(gisapi.polylineError, f);
    }
  },
  setAttributes: function (a) {
    this._attributes = DMap.$.extend(this._attributes, a);
  },
  getAttributes: function () {
    return DMap.$.extend({}, this._attributes);
  },
  setName: function (a) {
    this._name = a;
  },
  getName: function () {
    return this._name;
  },
  setDescription: function (a) {
    this._description = a;
  },
  getDescription: function (a) {
    return this._description;
  },
  setColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.color = a;
    this.setSymbol();
  },
  getColor: function () {
    return this.symbol.color;
  },
  setAnimateColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.animateColor = a;
    this.setSymbol();
  },
  getAnimateColor: function () {
    return this.symbol.animateColor;
  },
  setAnimateFromColor: function (a) {
    this.symbol.animateFromColor = a;
  },
  getAnimateFromColor: function () {
    return this.symbol.animateFromColor;
  },
  setWeight: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.weight = a;
    this.setSymbol();
  },
  getWeight: function () {
    return this.symbol.weight;
  },
  setOpacity: function (a) {
    var b = /^(0([\.]\d*[0-9]+)|0|1)$/;
    if (!b.test(a)) {
      alert(gisapi.validateNumber);
      return;
    }
    this.symbol.opacity = a;
    this.setSymbol();
  },
  getOpacity: function () {
    return this.symbol.opacity;
  },
  setDashstyle: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.dashstyle = a;
    this.setSymbol();
  },
  getDashstyle: function () {
    return this.symbol.dashstyle;
  },
  setFillColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillColor = a;
    this.setSymbol();
  },
  getFillColor: function () {
    return this.symbol.fillColor;
  },
  setFillColor2: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillColor2 = a;
    this.setSymbol();
  },
  getFillColor2: function () {
    return this.symbol.fillColor2;
  },
  setFillOpacity: function (b) {
    var a = /^(0([\.]\d*[0-9]+)|0|1)$/;
    if (!a.test(b)) {
      alert(gisapi.validateNumber);
      return;
    }
    this.symbol.fillOpacity = b;
    this.setSymbol();
  },
  getFillOpacity: function () {
    return this.symbol.fillOpacity;
  },
  setFillType: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillType = a;
    this.setSymbol();
  },
  getFillType: function () {
    return this.symbol.fillType;
  },
  setStartarrow: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.startarrow = a;
    this.setSymbol();
  },
  getStartarrow: function () {
    return this.symbol.startarrow;
  },
  setStartarrowwidth: function (a) {
    DMap.EhlException._isNull(_startarrow);
    DMap.EhlException.isTypeRight(_startarrow, 'string');
    this.symbol.startarrowwidth = a;
    this.setSymbol();
  },
  getStartarrowwidth: function () {
    return this.symbol.startarrowwidth;
  },
  setStartarrowlength: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.startarrowlength = a;
    this.setSymbol();
  },
  getStartarrowlength: function () {
    return this.symbol.startarrowlength;
  },
  setEndarrow: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrow = a;
    this.setSymbol();
  },
  getEndarrow: function () {
    return this.symbol.endarrow;
  },
  setEndarrowwidth: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrowwidth = a;
    this.setSymbol();
  },
  getEndarrowwidth: function () {
    return this.symbol.endarrowwidth;
  },
  setEndarrowlength: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrowlength = a;
    this.setSymbol();
  },
  getEndarrowlength: function () {
    return this.symbol.endarrowlength;
  },
  getSymbol: function () {
    return DMap.$.extend({}, this.symbol);
  },
  setAnimate: function (a) {
    if (a) {
      this._isAnimate = true;
      return true;
    }
    if (!a) {
      this._isAnimate = false;
      return false;
    }
  },
  getAnimate: function () {
    return this.isAnimate;
  },
  addAnimate: function (f, c) {
    var h;
    var e = this.symbol.weight;
    this.setSymbol(f);
    var g = this.symbol.color;
    this.setCommonEvent();
    this.removeAnimate();
    var d = this;
    if (this._isAnimate) {
      a();
    }

    function a() {
      h = setInterval(function () {
        if (!d._isAnimate) {
          b();
          return;
        }
        if (d.symbol.color != d.symbol.animateFromColor) {
          d.setSymbol({color: d.symbol.animateFromColor, weight: d.symbol.weight});
        } else {
          d.setSymbol({color: d.symbol.animateColor, weight: e});
        }
      }, c);
      d.isAnimate = true;
    }

    function b() {
      clearInterval(h);
      if (this._dom == null) {
        return;
      }
      d.setSymbol({color: g, weight: e});
      d.isAnimate = false;
    }

    if (!this._isAnimate) {
      DMap.$(d).bind('mouseover.animate', function () {
        if (!d.isAnimate) {
          a();
        }
      });
      DMap.$(d).bind('mouseout.animate', function () {
        if (d.isAnimate) {
          b();
        }
      });
      DMap.$.extend(d._dragObject, {
        drag: function (j, i) {
          if (d.isAnimate) {
            b();
          }
        }
      });
    }
  },
  removeAnimate: function () {
    DMap.$(this).unbind('.animate');
  },
  getLonLats: function () {
    return DMap.$.map(this._outRingLonlats, function (a) {
      return a.clone();
    });
  },
  setLonlats: function (d) {
    try {
      if (d instanceof Array) {
        this.parmLonlats = d;
      } else {
        alert(gisapi.lonlatArrayError);
        return;
      }
      this._innerRingLonlatsArray = [];
      if (d) {
        if (d.length == 0 || d[0].midLonLat) {
          this._outRingLonlats = d;
        } else {
          for (var b = 0, a = d.length; b < a; b++) {
            if (b == 0) {
              this._outRingLonlats = d[0];
            } else {
              this._innerRingLonlatsArray.push(d[b]);
            }
          }
        }
      } else {
        this._outRingLonlats = [];
      }
      this._setPath();
    } catch (c) {
      throw DMap.Util.createError(gisapi.setlonlatsError, c);
    }
  },
  getDoms: function () {
    return this._dom;
  },
  draw: function (a) {
    this._map = a;
    document.getElementById(a._panelPolylineId).appendChild(this._dom);
    this._setPath();
  },
  redraw: function (a) {
    if (this.clipPath || a) {
      this._setPath();
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  remove: function () {
    this.setAnimate(false);
    if (this._dom == null) {
      return;
    }
    DMap.$(this).trigger('clear');
    this.clearEvent();
    DMap.$(this._dom).unbind();
    DMap.$(this._dom).remove();
    this._dom.path = 'm1 2l';
    var a = document.getElementById('orphanContainer');
    if (!a) {
      a = document.createElement('div');
      a.id = 'orphanContainer';
      a.style.display = 'none';
      document.body.appendChild(a);
    }
    a.appendChild(this._dom);
    a.innerHTML = '';
    this.disableEditing();
    this._dom = null;
  },
  copy: function () {
    return new DMap.Polyline(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  _createDom: function () {
    if (DMap_browser >= 6 && DMap_browser < 10) {
      var a = document.createElement('<v:shape>');
      a.appendChild(document.createElement('<v:stroke>'));
      return a;
    } else {
      var b = document.createElementNS('http://www.w3.org/2000/svg', 'path');
      return b;
    }
  },
  setSymbol: function (c) {
    this.symbol = DMap.$.extend(this.symbol, c);
    if (DMap_browser >= 6 && DMap_browser < 10) {
      var a = this._dom;
      DMap.$(a).css({position: 'absolute', left: '0px', top: '0px', width: '1px', height: '1px'}).attr({
        filled: 'f',
        title: this.symbol.title || '',
        coordorigin: '0,0',
        coordsize: '1,1'
      });
      var b = {
        joinstyle: 'round',
        endcap: 'round',
        color: this.symbol.color,
        weight: this.symbol.weight + 'px',
        opacity: this.symbol.opacity,
        dashstyle: this.symbol.dashstyle,
        startarrow: this.symbol.startarrow,
        startarrowwidth: this.symbol.startarrowwidth,
        startarrowlength: this.symbol.startarrowlength,
        endarrow: this.symbol.endarrow,
        endarrowwidth: this.symbol.endarrowwidth,
        endarrowlength: this.symbol.endarrowlength
      };
      var e = a.childNodes[0];
      for (key in b) {
        e.setAttribute(key, b[key]);
      }
    } else {
      var d = this._dom;
      var b = {
        fill: 'none',
        'stroke-linejoin': 'round',
        'stroke-linecap': 'round',
        stroke: this.symbol.color,
        'stroke-width': this.symbol.weight,
        'stroke-opacity': this.symbol.opacity
      };
      for (key in b) {
        d.setAttribute(key, b[key]);
      }
    }
  },
  _getSinglePathStr: function (d) {
    d = DMap.ShapeHelper._openlayersCheckPixelArray(d, 15000);
    var e = [];
    for (var c = 0, b = d.length; c < b; c++) {
      var a = d[c];
      if (c == 0) {
        e[c] = 'm' + a.x + ',' + a.y + ' l ';
      } else {
        e[c] = a.x + ',' + a.y + ' ';
      }
    }
    return e.join('');
  },
  _setPath: function () {
    if (!this.isShow()) {
      return;
    }
    var h = this;
    var c = DMap.$.map(h._outRingLonlats, function (p, o) {
      var j = h._map.fromLonLatToDivPixel(p);
      return j;
    });
    var n = h._map.getSize();
    var f = h._map.fromContainerPixelToDivPixel(new DMap.Pixel(0, 0));
    var b = h._map.fromContainerPixelToDivPixel(new DMap.Pixel(n.w, n.h));
    var l = new DMap.Bounds(f.x - 1024, f.y - 768, b.x + 1024, b.y + 768);
    if (this.clipPath) {
      c = pathclip(c, l);
    }
    if (DMap_browser >= 6 && DMap_browser < 10) {
      var m = '';
      m += this._getSinglePathStr(c);
      for (var g = 0, e = this._innerRingLonlatsArray.length; g < e; g++) {
        var k = this._innerRingLonlatsArray[g];
        c = DMap.$.map(k, function (o, j) {
          return h._map.fromLonLatToDivPixel(o);
        });
        if (this.clipPath) {
          c = pathclip(c, l);
        }
        m += this._getSinglePathStr(c);
      }
      if (this._dom) {
        this._dom.path = m + 'e';
      }
    } else {
      c = DMap.ShapeHelper._openlayersCheckPixelArray(c, 15000);
      if (c.length == 0) {
        this._dom.setAttribute('d', '');
      } else {
        var a = 'M';
        var d = c[0];
        a += ' ' + d.x + ' ' + d.y + ' L';
        for (var g = 1, e = c.length; g < e; g++) {
          d = c[g];
          a += ' ' + d.x + ' ' + d.y;
        }
        this._dom.setAttribute('d', a);
      }
    }
    if (this._zIndex != null) {
      this._dom.style.zIndex = this._zIndex;
    }
  },
  clearEvent: function () {
    if (this._dragObject) {
      var a = this._dragObject.destory();
      this._dragObject = null;
    }
    DMap.$(this._dom).unbind().css('cursor', '');
    return this;
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setDragEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, dragstart: function () {
        DMap.$(a).trigger('dragstart');
      }, drag: function (c, b) {
        DMap.$(a).trigger('drag');
      }, dragend: function (b) {
        DMap.$(a).trigger('dragend');
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).css('cursor', 'default');
    return this;
  },
  isEditing: function () {
    return this._isEditing;
  },
  disableEditing: function () {
    this._isEditing = false;
    if (this._editMarkerArray) {
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
    }
    this._editMarkerArray = [];
    if (this._editPolyline1) {
      this._editPolyline1.remove();
      this._editPolyline1 = null;
    }
    if (this._editPolyline2) {
      this._editPolyline2.remove();
      this._editPolyline2 = null;
    }
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    this._editPolyline1 = new DMap.Polyline([new DMap.LonLat(119.15, 30.367), new DMap.LonLat(120.45, 30.667)], 'red', 3, 1);
    this._editPolyline2 = new DMap.Polyline([new DMap.LonLat(119.15, 30.367), new DMap.LonLat(120.45, 30.667)], 'red', 3, 1);
    this._editPolyline1.draw(e._map);
    this._editPolyline2.draw(e._map);
    this._editPolyline1.hide();
    this._editPolyline2.hide();
    var g = function (m) {
      e._editPolyline1.hide();
      e._editPolyline2.hide();
      if (parseInt(this.index) == this.index) {
        if (e.CLASS_NAME == 'Polygon') {
          if (this.index == e._outRingLonlats.length - 1) {
            e.updateVertex(0, this._lonlat);
          }
        }
        e.updateVertex(this.index, this._lonlat);
      } else {
        var l = this.index;
        for (var k = 0; k < e._editMarkerArray.length; k++) {
          var h = e._editMarkerArray[k].index;
          if (h > l) {
            e._editMarkerArray[k].index = h + 1;
          } else {
            if (h == l) {
              e._editMarkerArray[k].index = h + 0.5;
              e.insertVertex(this.index, this._lonlat);
              this.setOpacity(1);
            }
          }
        }
        var j = f(this.index - 1);
        if (j == undefined) {
          alert(gisapi.polylineVertexError + 'this.index-1' + this.index);
        } else {
          d(this._lonlat.midLonLat(j._lonlat), this.index - 0.5);
        }
        j = f(this.index + 1);
        if (j == undefined) {
          alert(gisapi.polylineVertexError + 'this.index+' + this.index);
        } else {
          d(this._lonlat.midLonLat(j._lonlat), this.index + 0.5);
        }
      }
    };
    var a = function (j) {
      var i, h;
      if (parseInt(this.index) == this.index) {
        i = this.index - 1;
        h = this.index + 1;
        if (this.index != 0) {
          f(this.index - 0.5).moveToLonlat(this._lonlat.midLonLat(e._outRingLonlats[i]));
        }
        if (this.index != e._outRingLonlats.length - 1) {
          f(this.index + 0.5).moveToLonlat(this._lonlat.midLonLat(e._outRingLonlats[h]));
        }
        if (e.CLASS_NAME == 'Polygon') {
          if (this.index == e._outRingLonlats.length - 1) {
            f(0).moveToLonlat(this._lonlat);
            f(0.5).moveToLonlat(this._lonlat.midLonLat(e._outRingLonlats[1]));
          }
        }
      } else {
        i = this.index - 0.5;
        h = this.index + 0.5;
      }
      if (this.index != 0) {
        e._editPolyline1.updateVertex(0, this._lonlat);
        e._editPolyline1.updateVertex(1, e._outRingLonlats[i]);
        e._editPolyline1.show();
      }
      if (this.index != e._outRingLonlats.length - 1) {
        e._editPolyline2.updateVertex(0, this._lonlat);
        e._editPolyline2.updateVertex(1, e._outRingLonlats[h]);
        e._editPolyline2.show();
      }
      if (e.CLASS_NAME == 'Polygon') {
        if (this.index == e._outRingLonlats.length - 1) {
          e._editPolyline2.updateVertex(0, this._lonlat);
          e._editPolyline2.updateVertex(1, e._outRingLonlats[1]);
          e._editPolyline2.show();
        }
      }
    };
    var f = function (h) {
      for (var j = 0; j < e._editMarkerArray.length; j++) {
        if (e._editMarkerArray[j].index == h) {
          return e._editMarkerArray[j];
        }
      }
    };
    var d = function (j, i) {
      var h = new DMap.Marker(j, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm'
      }).setOpacity(parseInt(i) == i ? 1 : 0.5).setDragEvent();
      h.index = i;
      h.draw(e._map);
      e._editMarkerArray.push(h);
      DMap.$(h).bind('dragend', g).bind('drag', a).bind('mouseover', function (k) {
        e._map.showFloatHelper('drag!');
      }).bind('mouseout', function (k) {
        e._map.hideFloatHelper();
      });
    };
    for (var c = 0, b = this._outRingLonlats.length; c < b; c++) {
      d(this._outRingLonlats[c], c);
      if (c != this._outRingLonlats.length - 1) {
        d(this._outRingLonlats[c].midLonLat(this._outRingLonlats[c + 1]), c + 0.5);
      }
    }
  },
  getVertexCount: function () {
    return this._outRingLonlats.length;
  },
  getVertex: function (a) {
    return this._outRingLonlats[a];
  },
  insertVertex: function (c, f) {
    try {
      if (c == 0) {
        this._outRingLonlats = [f].concat(this._outRingLonlats);
      } else {
        if (c >= this._outRingLonlats.length) {
          if (!this._outRingLonlats[this._outRingLonlats.length - 1].equals(f)) {
            this._outRingLonlats.push(f);
          }
        } else {
          var a = [];
          for (var d = 0, b = this._outRingLonlats.length; d < b; d++) {
            if (d == c) {
              a.push(f);
            }
            a.push(this._outRingLonlats[d]);
          }
          this._outRingLonlats = a;
        }
      }
      this._setPath();
    } catch (g) {
      throw DMap.Util.createError(gisapi.insertVertexError, g);
    }
  },
  updateVertex: function (a, b) {
    if (a < 0) {
    } else {
      if (a >= this._outRingLonlats.length) {
        this.insertVertex(this.getVertexCount(), b);
      } else {
        this._outRingLonlats[a] = b;
      }
    }
    this._setPath();
  },
  deleteVertex: function (a) {
    if (0 <= a < this._outRingLonlats.length) {
      this._outRingLonlats.splice(a, 1);
      this._setPath();
    }
  },
  getLength: function () {
  },
  getLonLatBounds: function () {
    return DMap.LonLatBounds.fromLonLatArray(this._outRingLonlats);
  },
  setStrokeStyle: function () {
  }
});
DMap.Polyline.clone = function (a) {
  return new DMap.Polyline(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.Polyline.printable = true;
DMap.Class('MultiLineString', DMap.Overlay, {
  _items: null,
  symbol: null,
  _attributes: null,
  initialize: function (a, d, e) {
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException.isTypeRight(a, 'object');
    this._items = [];
    for (var b = 0; b < a.length; b++) {
      var c = a[b];
      this._items.push(new DMap.Polyline(c, d));
    }
    this.symbol = {
      color: 'red',
      animateColor: 'white',
      animateFromColor: 'red',
      weight: 2,
      opacity: 1,
      dashstyle: 'solid',
      fillColor: 'blue',
      fillOpacity: 0.5,
      fillType: 'solid',
      startarrow: 'none',
      startarrowwidth: 'medium',
      startarrowlength: 'medium',
      endarrow: 'none',
      endarrowwidth: 'medium',
      endarrowlength: 'medium'
    };
    this.setSymbol(d);
    this._attributes = e;
  },
  setColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.color = a;
    this.setSymbol();
  },
  getColor: function () {
    return this.symbol.color;
  },
  setAnimateColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.animateColor = a;
    this.setSymbol();
  },
  getAnimateColor: function () {
    return this.symbol.animateColor;
  },
  setWeight: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.weight = a;
    this.setSymbol();
  },
  getWeight: function () {
    return this.symbol.weight;
  },
  setOpacity: function (a) {
    var b = /^(0([\.]\d*[0-9]+)|0|1)$/;
    if (!b.test(a)) {
      alert(gisapi.validateNumber);
      return;
    }
    this.symbol.opacity = a;
    this.setSymbol();
  },
  getOpacity: function () {
    return this.symbol.opacity;
  },
  setDashstyle: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.dashstyle = a;
    this.setSymbol();
  },
  getDashstyle: function () {
    return this.symbol.dashstyle;
  },
  setFillColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillColor = a;
    this.setSymbol();
  },
  getFillColor: function () {
    return this.symbol.fillColor;
  },
  setFillOpacity: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillOpacity = a;
    this.setSymbol();
  },
  getFillOpacity: function () {
    return this.symbol.fillOpacity;
  },
  setFillType: function (a) {
    DMap.EhlException._isNull(_fillOpacity);
    DMap.EhlException.isTypeRight(_fillOpacity, 'string');
    this.symbol.fillType = a;
    this.setSymbol();
  },
  getFillType: function () {
    return this.symbol.fillType;
  },
  setStartarrow: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.startarrow = a;
    this.setSymbol();
  },
  getStartarrow: function () {
    return this.symbol.startarrow;
  },
  setStartarrowwidth: function (a) {
    DMap.EhlException._isNull(_startarrow);
    DMap.EhlException.isTypeRight(_startarrow, 'string');
    this.symbol.startarrowwidth = a;
    this.setSymbol();
  },
  getStartarrowwidth: function () {
    return this.symbol.startarrowwidth;
  },
  setStartarrowlength: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.startarrowlength = a;
    this.setSymbol();
  },
  getStartarrowlength: function () {
    return this.symbol.startarrowlength;
  },
  setEndarrow: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrow = a;
    this.setSymbol();
  },
  getEndarrow: function () {
    return this.symbol.endarrow;
  },
  setEndarrowwidth: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrowwidth = a;
    this.setSymbol();
  },
  getEndarrowwidth: function () {
    return this.symbol.endarrowwidth;
  },
  setEndarrowlength: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrowlength = a;
    this.setSymbol();
  },
  getEndarrowlength: function () {
    return this.symbol.endarrowlength;
  },
  getDoms: function () {
    var c = [];
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      c = c.concat(b.getDoms());
    }
    return c;
  },
  draw: function (c) {
    this._map = c;
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.draw(c);
    }
  },
  redraw: function (c) {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.redraw(c);
    }
  },
  remove: function () {
    this.clearEvent();
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.remove();
    }
  },
  setSymbol: function (c) {
    this.symbol = DMap.$.extend(this.symbol, c || {});
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.setSymbol(this.symbol);
    }
  },
  getSymbol: function () {
    return DMap.$.extend({}, this.symbol);
  },
  setAttributes: function (a) {
    this._attributes = DMap.$.extend(this._attributes, a);
  },
  getAttributes: function () {
    return DMap.$.extend({}, this._attributes);
  },
  getLonLats: function () {
    var b = [];
    for (var c = 0; c < this._items.length; c++) {
      var d = this._items[c];
      var e = d.getLonLats();
      for (var a = 0; a < e.length; a++) {
        b.push(e[a]);
      }
    }
    return b;
  },
  setCommonEvent: function () {
    var c = this;
    c.clearEvent();
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      DMap.$(b._dom).bind('click', function (d) {
        DMap.$(c).trigger('click', [c._map.fromMouseEventToLonLat(d)]);
      }).bind('mouseenter', function (d) {
        DMap.$(c).trigger('mouseover');
        return false;
      }).bind('mouseleave', function (d) {
        DMap.$(c).trigger('mouseout');
        return false;
      }).bind('contextmenu', function (d) {
        DMap.$(c).trigger('rightclick');
        return false;
      }).css('cursor', 'pointer').preventBubbles('mousedown');
    }
    return this;
  },
  clearEvent: function () {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      DMap.$(b._dom).unbind().css('cursor', '');
    }
    return this;
  },
  addAnimate: function (b, a) {
    var d;
    this.setSymbol(b);
    var c = this.symbol.color;
    this.setCommonEvent();
    DMap.$(this).bind('mouseover.animate', function () {
      var e = this;
      d = setInterval(function () {
        if (e.symbol.color != e.symbol.animateFromColor) {
          e.setSymbol({color: e.symbol.animateFromColor});
        } else {
          e.setSymbol({color: e.symbol.animateColor});
        }
      }, a);
    });
    DMap.$(this).bind('mouseout.animate', function () {
      clearInterval(d);
      this.setSymbol({color: c});
    });
  },
  removeAnimate: function () {
    DMap.$(this).unbind('mouseover.animate');
  }
});
DMap.MultiLineString.clone = function (a) {
  return new DMap.MultiLineString(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.MultiLineString.printable = true;
DMap.Class('Polygon', DMap.Polyline, {
  draw: function (a) {
    this._map = a;
    document.getElementById(a._panelPolygonId).appendChild(this._dom);
    this._setPath();
  }, setSymbol: function () {
    DMap.Polyline.prototype.setSymbol.apply(this, arguments);
    if (DMap_browser >= 6 && DMap_browser < 10) {
      this._dom.setAttribute('filled', 't');
      var a = document.createElement('<v:fill>');
      this._dom.appendChild(a);
      a.setAttribute('opacity', this.symbol.fillOpacity);
      a.setAttribute('color', this.symbol.fillColor);
      a.setAttribute('type', this.symbol.fillType);
    } else {
      this._dom.setAttribute('fill', this.symbol.fillColor);
      this._dom.setAttribute('fill-opacity', this.symbol.fillOpacity);
    }
  }, getLonLats: function () {
    var a = DMap.$.map(this._outRingLonlats, function (b) {
      return b.clone();
    });
    if (!a[a.length - 1].equals(a[0])) {
      a.push(a[0].clone());
    }
    return a;
  }, copy: function () {
    return new DMap.Polygon(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }
});
DMap.Polygon.clone = function (a) {
  return new DMap.Polygon(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.Polygon.printable = true;
DMap.Class('MultiPolygon', DMap.Overlay, {
  _items: null,
  symbol: null,
  _attributes: null,
  initialize: function (a, d, e) {
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException.isTypeRight(a, 'object');
    this._items = [];
    for (var b = 0; b < a.length; b++) {
      var c = a[b];
      this._items.push(new DMap.Polygon(c, d));
    }
    this.symbol = {
      color: 'red',
      animateColor: 'white',
      animateFromColor: 'red',
      weight: 2,
      opacity: 1,
      dashstyle: 'solid',
      fillColor: 'blue',
      fillOpacity: 0.5,
      fillType: 'solid',
      startarrow: 'none',
      startarrowwidth: 'medium',
      startarrowlength: 'medium',
      endarrow: 'none',
      endarrowwidth: 'medium',
      endarrowlength: 'medium'
    };
    this.setSymbol(d);
    this._attributes = e;
  },
  setColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.color = a;
    this.setSymbol();
  },
  getColor: function () {
    return this.symbol.color;
  },
  setAnimateColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.animateColor = a;
    this.setSymbol();
  },
  getAnimateColor: function () {
    return this.symbol.animateColor;
  },
  setWeight: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.weight = a;
    this.setSymbol();
  },
  getWeight: function () {
    return this.symbol.weight;
  },
  setOpacity: function (a) {
    var b = /^(0([\.]\d*[0-9]+)|0|1)$/;
    if (!b.test(a)) {
      alert(gisapi.validateNumber);
      return;
    }
    this.symbol.opacity = a;
    this.setSymbol();
  },
  getOpacity: function () {
    return this.symbol.opacity;
  },
  setDashstyle: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.dashstyle = a;
    this.setSymbol();
  },
  getDashstyle: function () {
    return this.symbol.dashstyle;
  },
  setFillColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillColor = a;
    this.setSymbol();
  },
  getFillColor: function () {
    return this.symbol.fillColor;
  },
  setFillOpacity: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.fillOpacity = a;
    this.setSymbol();
  },
  getFillOpacity: function () {
    return this.symbol.fillOpacity;
  },
  setFillType: function (a) {
    DMap.EhlException._isNull(_fillOpacity);
    DMap.EhlException.isTypeRight(_fillOpacity, 'string');
    this.symbol.fillType = a;
    this.setSymbol();
  },
  getFillType: function () {
    return this.symbol.fillType;
  },
  setStartarrow: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.startarrow = a;
    this.setSymbol();
  },
  getStartarrow: function () {
    return this.symbol.startarrow;
  },
  setStartarrowwidth: function (a) {
    DMap.EhlException._isNull(_startarrow);
    DMap.EhlException.isTypeRight(_startarrow, 'string');
    this.symbol.startarrowwidth = a;
    this.setSymbol();
  },
  getStartarrowwidth: function () {
    return this.symbol.startarrowwidth;
  },
  setStartarrowlength: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.startarrowlength = a;
    this.setSymbol();
  },
  getStartarrowlength: function () {
    return this.symbol.startarrowlength;
  },
  setEndarrow: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrow = a;
    this.setSymbol();
  },
  getEndarrow: function () {
    return this.symbol.endarrow;
  },
  setEndarrowwidth: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrowwidth = a;
    this.setSymbol();
  },
  getEndarrowwidth: function () {
    return this.symbol.endarrowwidth;
  },
  setEndarrowlength: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.endarrowlength = a;
    this.setSymbol();
  },
  getEndarrowlength: function () {
    return this.symbol.endarrowlength;
  },
  getDoms: function () {
    var c = [];
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      c = c.concat(b.getDoms());
    }
    return c;
  },
  draw: function (c) {
    this._map = c;
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.draw(c);
    }
  },
  redraw: function (c) {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.redraw(c);
    }
  },
  remove: function () {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.remove();
    }
  },
  setSymbol: function (c) {
    this.symbol = DMap.$.extend(this.symbol, c || {});
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.setSymbol(this.symbol);
    }
  },
  getSymbol: function () {
    return DMap.$.extend({}, this.symbol);
  },
  setAttributes: function (a) {
    this._attributes = DMap.$.extend(this._attributes, a);
  },
  getAttributes: function () {
    return DMap.$.extend({}, this._attributes);
  },
  getLonLats: function () {
    var b = new Array();
    for (var c = 0; c < this._items.length; c++) {
      var d = this._items[c];
      var e = d.getLonLats();
      for (var a = 0; a < e.length; a++) {
        b.push(e[a]);
      }
    }
    return b;
  },
  setCommonEvent: function () {
    var c = this;
    c.clearEvent();
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      DMap.$(b._dom).bind('click', function (d) {
        DMap.$(c).trigger('click', [c._map.fromMouseEventToLonLat(d)]);
      }).bind('mouseenter', function (d) {
        DMap.$(c).trigger('mouseover');
        return false;
      }).bind('mouseleave', function (d) {
        DMap.$(c).trigger('mouseout');
        return false;
      }).bind('contextmenu', function (d) {
        DMap.$(c).trigger('rightclick');
        return false;
      }).css('cursor', 'pointer').preventBubbles('mousedown');
    }
    return this;
  },
  addAnimate: function (b, a) {
    var d;
    this.setSymbol(b);
    var c = this.symbol.color;
    this.setCommonEvent();
    DMap.$(this).bind('mouseover.animate', function () {
      var e = this;
      d = setInterval(function () {
        if (e.symbol.color != e.symbol.animateFromColor) {
          e.setSymbol({color: e.symbol.animateFromColor});
        } else {
          e.setSymbol({color: e.symbol.animateColor});
        }
      }, a);
    });
    DMap.$(this).bind('mouseout.animate', function () {
      clearInterval(d);
      this.setSymbol({color: c});
    });
  },
  removeAnimate: function () {
    DMap.$(this).unbind('mouseover.animate');
  },
  clearEvent: function () {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      DMap.$(b._dom).unbind().css('cursor', '');
    }
    return this;
  }
});
DMap.MultiPolygon.clone = function (a) {
  return new DMap.MultiPolygon(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.MultiPolygon.printable = true;
DMap.Class('RoundLine', DMap.Polyline, {
  lonlatAndR: null, _lonlats: [], initialize: function (b, c, a) {
    DMap.EhlException.isTypeRight(b, 'undefined');
    DMap.EhlException.isTypeRight(b, 'object');
    DMap.EhlException.isTypeRight(b[0], 'DMap.LonLat');
    DMap.Polygon.prototype.initialize.apply(this, arguments);
    this.lonlatAndR = b;
    this._outRingLonlats = this._fromLonlatAndRToLonlatArray();
    this._lonlats = [this.lonlatAndR[0], this._outRingLonlats[0]];
  }, _fromLonlatAndRToLonlatArray: function () {
    var c = [];
    var f = this.lonlatAndR[0];
    var b = DMap.Util.getDegreeFromMeasure(this.lonlatAndR[1]);
    var g = 80;
    for (var e = 0; e < g; e++) {
      var h = Math.sin(Math.PI * 2 * e / g);
      var d = Math.cos(Math.PI * 2 * e / g);
      var a = f.lon + parseFloat(b) * d;
      var j = f.lat + parseFloat(b) * h;
      c.push(new DMap.LonLat(a, j));
    }
    c.push(c[0].clone());
    return c;
  }, setLonlatAndR: function (a) {
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException.isTypeRight(a, 'object');
    DMap.EhlException.isTypeRight(a[0], 'DMap.LonLat');
    DMap.EhlException.isTypeRight(a[1], 'number');
    this.lonlatAndR = a;
    this._outRingLonlats = this._fromLonlatAndRToLonlatArray();
    this._setPath();
  }, setLonlats: function (a) {
    if (a) {
      var c = a[0];
      var b;
      if (DCMapServer.GlobeParams.MapProjection == 1) {
        b = Math.sqrt((Math.pow((a[1].lon - a[0].lon), 2)) + Math.pow((a[1].lat - a[0].lat), 2));
      } else {
        b = DMap.Util.degreeToMeter(b);
      }
      this.setLonlatAndR([c, b]);
    }
  }, getLonlats: function () {
    return this._lonlats;
  }, enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonlats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('drag', a);
    };
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, copy: function () {
    return new DMap.RoundLine(this.getLonlatAndR(), this.getSymbol(), this.getAttributes());
  }, getLonlatAndR: function () {
    return [this.lonlatAndR[0].clone(), this.lonlatAndR[1]];
  }
});
DMap.RoundLine.clone = function (a) {
  return new DMap.RoundLine(a.getLonlatAndR(), a.getSymbol(), a.getAttributes());
};
DMap.RoundLine.printable = true;
DMap.Class('Round', DMap.RoundLine, {
  setSymbol: function () {
    DMap.Polyline.prototype.setSymbol.apply(this, arguments);
    if (DMap_browser >= 6 && DMap_browser < 10) {
      this._dom.setAttribute('filled', 't');
      var a = document.createElement('<v:fill>');
      this._dom.appendChild(a);
      a.setAttribute('opacity', this.symbol.fillOpacity);
      a.setAttribute('color', this.symbol.fillColor);
      a.setAttribute('type', this.symbol.fillType);
    } else {
      this._dom.setAttribute('fill', this.symbol.fillColor);
      this._dom.setAttribute('fill-opacity', this.symbol.fillOpacity);
    }
  }, getLonLats: function () {
    var a = DMap.$.map(this._outRingLonlats, function (b) {
      return b.clone();
    });
    if (!a[a.length - 1].equals(a[0])) {
      a.push(a[0].clone());
    }
    return a;
  }, copy: function () {
    return new DMap.Round(this.getLonlatAndR(), this.getSymbol(), this.getAttributes());
  }
});
DMap.Round.clone = function (a) {
  return new DMap.Round(a.getLonlatAndR(), a.getSymbol(), a.getAttributes());
};
DMap.Round.printable = true;
DMap.Class('ActionArrow', DMap.Polyline, {
  setSymbol: function () {
    DMap.Polyline.prototype.setSymbol.apply(this, arguments);
    if (DMap_browser >= 6 && DMap_browser < 10) {
      this._dom.setAttribute('filled', 't');
      var a = document.createElement('<v:fill o:opacity2="1" type = "gradient" opacity = ".5" color2 = "red"></v:fill>');
      this._dom.appendChild(a);
      a.setAttribute('opacity', this.symbol.fillOpacity);
      a.setAttribute('color', this.symbol.fillColor);
      a.setAttribute('color2', this.symbol.fillColor2);
      a.setAttribute('type', 'gradient');
      this._fillDom = a;
    } else {
      this._dom.setAttribute('fill', this.symbol.fillColor);
      this._dom.setAttribute('fill-opacity', this.symbol.fillOpacity);
    }
  }, _p0: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[0]);
  }, _p1: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[1]);
  }, _p2: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[2]);
  }, _p3: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[3]);
  }, _p4: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[4]);
  }, _p5: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[5]);
  }, _p6: function () {
    return this._map.fromLonLatToDivPixel(this._outRingLonlats[6]);
  }, _pA1: function (b) {
    if (!b) {
      b = this._v();
    }
    var a = b.getMod() * 0.3;
    var c = b.getPoint(a, this._d2r(30));
    c.x |= 0;
    c.y |= 0;
    return c;
  }, _pA2: function (b) {
    if (!b) {
      b = this._v();
    }
    var a = b.getMod() * 0.3;
    var c = b.getPoint(a, this._d2r(-30));
    c.x |= 0;
    c.y |= 0;
    return c;
  }, _pB1: function (b) {
    if (!b) {
      b = this._v();
    }
    var a = b.getMod() * 0.2;
    var c = b.getPoint(a, this._d2r(15));
    c.x |= 0;
    c.y |= 0;
    return c;
  }, _pB2: function (b) {
    if (!b) {
      b = this._v();
    }
    var a = b.getMod() * 0.2;
    var c = b.getPoint(a, this._d2r(-15));
    c.x |= 0;
    c.y |= 0;
    return c;
  }, _pC1: function (b) {
    if (!b) {
      b = this._v();
    }
    var a = b.getMod() * 0.5;
    var c = b.getPoint(a, this._d2r(15));
    c.x |= 0;
    c.y |= 0;
    return c;
  }, _pC2: function (b) {
    if (!b) {
      b = this._v();
    }
    var a = b.getMod() * 0.5;
    var c = b.getPoint(a, this._d2r(-15));
    c.x |= 0;
    c.y |= 0;
    return c;
  }, _d2r: function (a) {
    return (Math.PI / 180) * a;
  }, _r2d: function (a) {
    return a / Math.PI * 180;
  }, _v: function () {
    var b = this._p0();
    var a = this._p3();
    return this._getV(b, a);
  }, _getV: function (b, a) {
    return new Vector2D(b, a);
  }, _l: function () {
    return this._v().getMod();
  }, getAngle: function () {
    return this._r2d(this._v().getAngle());
  }, _setPath: function () {
    try {
      var w = this;
      var i = function (e) {
        if (e) {
          e = new DMap.Pixel(e.x, e.y);
        }
        var v = w._map.fromContainerPixelToLonLat(e);
        var z = new DMap.Marker(v);
        w._map.addOverlay(z);
      };
      var h = this._p0();
      var d = this._pA1();
      var b = this._pA2();
      var k = this._pB1();
      var j = this._pB2();
      var g = this._p1();
      var f = this._p2();
      var c = this._p3();
      if (DMap_browser >= 6 && DMap_browser < 10) {
        var o = '';
        if (this._outRingLonlats.length > 4) {
          var a = this._p4();
          var y = this._p5();
          var x = this._p6();
          var l = this._getV(a, y);
          var s = this._pA1(l);
          var q = this._pA2(l);
          var n = this._pB1(l);
          var m = this._pB2(l);
          var r = this._pC2(this._v());
          var p = this._pC1(l);
          o = 'm{0},{1} qb {2},{3} l{4},{5} {6},{7} {8},{9} {10},{11} {12},{13} qb {30},{31} qb {14},{15} qb {32},{33} l {28},{29} {16},{17} {18},{19} {20},{21} {22},{23} qb {24},{25} l{26},{27} e'.format([g.x, g.y, c.x, c.y, k.x, k.y, d.x, d.y, h.x, h.y, b.x, b.y, j.x, j.y, x.x, x.y, s.x, s.y, a.x, a.y, q.x, q.y, m.x, m.y, y.x, y.y, f.x, f.y, n.x, n.y, r.x, r.y, p.x, p.y]);
        } else {
          o = 'm{0},{1} qb {2},{3} l{4},{5} {6},{7} {8},{9} {10},{11} {12},{13} qb {2},{3} l{14},{15} e'.format([g.x, g.y, c.x, c.y, k.x, k.y, d.x, d.y, h.x, h.y, b.x, b.y, j.x, j.y, f.x, f.y]);
        }
        this._dom.path = o;
        var t = 90 - (this.getAngle() | 0);
        if (t < 0) {
          t += 360;
        } else {
          if (t > 360) {
            t -= 360;
          }
        }
        this._fillDom.setAttribute('angle', t);
      } else {
        var o = '';
        if (this._outRingLonlats.length > 4) {
          var a = this._p4();
          var y = this._p5();
          var x = this._p6();
          var l = this._getV(a, y);
          var s = this._pA1(l);
          var q = this._pA2(l);
          var n = this._pB1(l);
          var m = this._pB2(l);
          var r = this._pC2(this._v());
          var p = this._pC1(l);
          o = 'M{0},{1} Q {2},{3} {4},{5} L{4},{5} {6},{7} {8},{9} {10},{11} {12},{13} Q {14},{15} {28},{29} L {28},{29} {16},{17} {18},{19} {20},{21} {22},{23}Q {24},{25} {26},{27}'.format([g.x, g.y, c.x, c.y, k.x, k.y, d.x, d.y, h.x, h.y, b.x, b.y, j.x, j.y, x.x, x.y, s.x, s.y, a.x, a.y, q.x, q.y, m.x, m.y, y.x, y.y, f.x, f.y, n.x, n.y]);
        } else {
          o = 'M{0},{1} Q {2},{3} {4},{5} L{4},{5} {6},{7} {8},{9} {10},{11} {12},{13} Q {2},{3} {14},{15}'.format([g.x, g.y, c.x, c.y, k.x, k.y, d.x, d.y, h.x, h.y, b.x, b.y, j.x, j.y, f.x, f.y]);
        }
        this._dom.setAttribute('d', o);
      }
    } catch (u) {
      throw DMap.EhlException.createError(gisapi.actionArrowError, u);
    }
  }, enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e.updateVertex(this.index, this._lonlat);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('drag', a);
    };
    for (var c = 0, b = this._outRingLonlats.length; c < b; c++) {
      d(this._outRingLonlats[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, remove: function () {
    this._fillDom = null;
    DMap.Polyline.prototype.remove.call(this);
  }, _createDom: function () {
    if (DMap_browser >= 6 && DMap_browser < 10) {
      var a = document.createElement('<v:shape>');
      a.appendChild(document.createElement('<v:stroke>'));
      return a;
    } else {
      var b = document.createElementNS('http://www.w3.org/2000/svg', 'path');
      return b;
    }
  }
});
DMap.Class('MarkerClusterer', {
  _map: null, sizes: [53, 56, 66, 78, 90], _styles: [], initialize: function (e, a, d) {
    DMap.EhlException.isTypeRight(e, 'undefined');
    DMap.EhlException.isTypeRight(e, 'DMap.Map');
    DMap.EhlException.isTypeRight(e, 'object');
    this._clusters = [];
    this._ready = false;
    this._markers = [];
    this._map = e;
    var b = d || {};
    this._gridSize = b.gridSize || 60;
    this._minClusterSize = b.minimumClusterSize || 2;
    this._maxZoom = b.maxZoom || null;
    this._styles = b.styles || [];
    this._imagePath = b.imagePath || this.MARKER_CLUSTER_IMAGE_PATH_;
    this._imageExtension = b.imageExtension || this.MARKER_CLUSTER_IMAGE_EXTENSION_;
    this._zoomOnClick = true;
    if (b.zoomOnClick != undefined) {
      this._zoomOnClick = b.zoomOnClick;
    }
    this._averageCenter = false;
    if (b.averageCenter != undefined) {
      this._averageCenter = b.averageCenter;
    }
    this.setupStyles();
    this.setMap(e);
    this.onAdd();
    this._prevZoom = this._map.getZoom();
    var c = this;
    DMap.$(this._map).bind('zoomend', function () {
      var f = c._map.getZoom();
      if (c._prevZoom != f) {
        c._prevZoom = f;
        c.resetViewport();
      }
    });
    this._map.addMapChangeListener(function () {
      c.redraw();
    });
    if (a && a.length) {
      this.addMarkers(a, false);
    }
  }, addMarkers: function (d, c) {
    for (var b = 0, a; a = d[b]; b++) {
      this.pushMarkerTo(a);
    }
    if (!c) {
      this.redraw();
    }
  }, addMarker: function (a, b) {
    this.pushMarkerTo(a);
    if (!b) {
      this.redraw();
    }
  }, _removeMarker: function (b) {
    var c = -1;
    if (this._markers.indexOf) {
      c = this._markers.indexOf(b);
    } else {
      for (var d = 0, a; a = this._markers[d]; d++) {
        if (a == b) {
          c = d;
          break;
        }
      }
    }
    if (c == -1) {
      return false;
    }
    this._map.removeOverlay(b);
    this._markers.splice(c, 1);
    return true;
  }, removeMarker: function (a, b) {
    var c = this._removeMarker(a);
    if (!b && c) {
      this.resetViewport();
      this.redraw();
      return true;
    } else {
      return false;
    }
  }, removeMarkers: function (f, c) {
    var e = false;
    for (var b = 0, a; a = f[b]; b++) {
      var d = this._removeMarker(a);
      e = e || d;
    }
    if (!c && e) {
      this.resetViewport();
      this.redraw();
      return true;
    }
  }, pushMarkerTo: function (a) {
    a.isAdded = false;
    this._markers.push(a);
  }, isZoomOnClick: function () {
    return this._zoomOnClick;
  }, isAverageCenter: function () {
    return this._averageCenter;
  }, getMarkers: function () {
    return this._markers;
  }, getTotalMarkers: function () {
    return this._markers.length;
  }, setMaxZoom: function (a) {
    this._maxZoom = a;
  }, getMaxZoom: function () {
    return this._maxZoom;
  }, calculator_: function (e, d) {
    var a = 0;
    var c = e.length;
    var b = c;
    while (b !== 0) {
      b = parseInt(b / 10, 10);
      a++;
    }
    a = Math.min(a, d);
    return {text: c, index: a};
  }, setCalculator: function (a) {
    this.calculator_ = a;
  }, getCalculator: function () {
    return this.calculator_;
  }, draw: function () {
  }, redraw: function () {
    this._createClusters();
  }, _createClusters: function () {
    var h = new Date();
    if (!this._ready) {
      return;
    }
    var d = this._map.getBounds();
    var f = this.getExtendedBounds(d);
    var h = new Date();
    try {
      for (var c = 0, b; b = this._markers[c]; c++) {
        if (!b.isAdded && this.isMarkerInBounds(b, f)) {
          this._addToClosestCluster(b);
        }
      }
    } catch (g) {
    }
    var a = new Date();
  }, distanceBetweenPoints_: function (j, h) {
    if (!j || !h) {
      return 0;
    }
    var g = 6371;
    var e = (h.lat - j.lat) * Math.PI / 180;
    var f = (h.lon - j.lon) * Math.PI / 180;
    var b = Math.sin(e / 2) * Math.sin(e / 2) + Math.cos(j.lat * Math.PI / 180) * Math.cos(h.lat * Math.PI / 180) * Math.sin(f / 2) * Math.sin(f / 2);
    var k = 2 * Math.atan2(Math.sqrt(b), Math.sqrt(1 - b));
    var i = g * k;
    return i;
  }, _addToClosestCluster: function (c) {
    var j = 40000 * 2;
    var f = null;
    var h = c.getLonlat();
    for (var e = 0, b; b = this._clusters[e]; e++) {
      var a = b.getCenter();
      if (a) {
        var g = this.distanceBetweenPoints_(a, c.getLonlat());
        if (g < j) {
          j = g;
          f = b;
        }
      }
    }
    if (f && f.isMarkerInClusterBounds(c)) {
      f.addMarker(c);
    } else {
      var b = new Cluster(this);
      b.addMarker(c);
      this._clusters.push(b);
    }
  }, getExtendedBounds: function (d) {
    var b = this._map.fromLonLatToDivPixel(d.wn());
    b.x += this._gridSize;
    b.y -= this._gridSize;
    var a = this._map.fromLonLatToDivPixel(d.es());
    a.x -= this._gridSize;
    a.y += this._gridSize;
    var c = this._map.fromDivPixelToLonLat(b);
    var g = this._map.fromDivPixelToLonLat(a);
    var f = new Array();
    f.push(c);
    f.push(g);
    var e = DMap.LonLatBounds.fromLonLatArray(f);
    return e;
  }, isMarkerInBounds: function (a, b) {
    return b.contains(a.getLonlat());
  }, onAdd: function () {
    this.setReady(true);
  }, setReady: function (a) {
    if (!this._ready) {
      this._ready = a;
      this._createClusters();
    }
  }, resetViewport: function (d) {
    for (var c = 0, a; a = this._clusters[c]; c++) {
      a.remove();
    }
    for (var c = 0, b; b = this._markers[c]; c++) {
      b.isAdded = false;
      if (d) {
        this._map.removeOverlay(b);
      }
    }
    this._clusters = [];
  }, setupStyles: function () {
    if (this._styles.length) {
      return;
    }
    for (var b = 0, a; a = this.sizes[b]; b++) {
      this._styles.push({url: this._imagePath + (b + 1) + '.' + this._imageExtension, height: a, width: a});
    }
  }, setStyles: function (a) {
    this._styles = a;
  }, getStyles: function () {
    return this._styles;
  }, getTotalClusters: function () {
    return this._clusters.length;
  }, setMap: function (a) {
    this._map = a;
  }, getMap: function () {
    return this._map;
  }, getGridSize: function () {
    return this._gridSize;
  }, setGridSize: function (a) {
    this._gridSize = a;
  }, setMinClusterSize: function (a) {
    this._minClusterSize = a;
  }, getMinClusterSize: function () {
    return this._minClusterSize;
  }, getTotalClusters: function () {
    return this._clusters.length;
  }, setGridSize: function (a) {
    this._gridSize = a;
  }, getGridSize: function () {
    return this._gridSize;
  }, repaint: function () {
    var a = this._clusters.slice();
    this._clusters.length = 0;
    this.resetViewport();
    this.redraw();
    window.setTimeout(function () {
      for (var c = 0, b; b = a[c]; c++) {
        b.remove();
      }
    }, 0);
  }, clearMarkers: function () {
    this.resetViewport(true);
    this._markers = [];
  }, extend: function (b, a) {
    return (function (c) {
      for (var d in c.prototype) {
        this.prototype[d] = c.prototype[d];
      }
      return this;
    }).apply(b, [a]);
  }, MARKER_CLUSTER_IMAGE_PATH_: m_mapgis + '/lib/images/markerclusterer/m', MARKER_CLUSTER_IMAGE_EXTENSION_: 'png'
});

function Cluster(a) {
  this.markerClusterer_ = a;
  this.map_ = a.getMap();
  this.gridSize_ = a.getGridSize();
  this.minClusterSize_ = a.getMinClusterSize();
  this.averageCenter_ = a.isAverageCenter();
  this.center_ = null;
  this._markers = [];
  this.bounds_ = null;
  this.clusterIcon_ = new ClusterIcon(this, a.getStyles(), a.getGridSize());
}

Cluster.prototype.isMarkerAlreadyAdded = function (b) {
  if (this._markers && this._markers.indexOf) {
    return this._markers.indexOf(b) != -1;
  } else {
    for (var c = 0, a; a = this._markers[c]; c++) {
      if (a == b) {
        return true;
      }
    }
  }
  return false;
};
Cluster.prototype.addMarker = function (c) {
  if (this.isMarkerAlreadyAdded(c)) {
    return false;
  }
  if (!this.center_) {
    this.center_ = c.getLonlat();
    this.calculateBounds_();
  } else {
    if (this.averageCenter_) {
      var b = this._markers.length + 1;
      var f = (this.center_.lon * (b - 1) + c.getLonlat().lon) / b;
      var d = (this.center_.lat * (b - 1) + c.getLonlat().lat) / b;
      this.center_ = new DMap.LonLat(f, d);
      this.calculateBounds_();
    }
  }
  c.isAdded = true;
  this._markers.push(c);
  var a = this._markers.length;
  if (a < this.minClusterSize_ && !c.isHidden()) {
    c.show(false);
  }
  if (a == this.minClusterSize_) {
    for (var e = 0; e < a; e++) {
      this._markers[e].hide(false);
    }
  }
  if (a >= this.minClusterSize_) {
    c.hide(false);
  }
  this.updateIcon();
  return true;
};
Cluster.prototype.getMarkerClusterer = function () {
  return this.markerClusterer_;
};
Cluster.prototype.getBounds = function () {
  var f = new Array();
  f.push(this.center_);
  f.push(this.center_);
  var d = DMap.LonLatBounds.fromLonLatArray(f);
  var g = this.getMarkers();
  var b = new Array();
  for (var c = 0, a; a = g[c]; c++) {
    b.push(a.getLonlat());
    this.map_.addOverlay(a);
  }
  var e = DMap.LonLatBounds.fromLonLatArray(b);
  return e;
};
Cluster.prototype.remove = function () {
  this.clusterIcon_.remove();
  try {
    this._markers = [];
  } catch (a) {
  }
};
Cluster.prototype.getSize = function () {
  return this._markers.length;
};
Cluster.prototype.getMarkers = function () {
  return this._markers;
};
Cluster.prototype.getCenter = function () {
  return this.center_;
};
Cluster.prototype.calculateBounds_ = function () {
  var b = new Array();
  b.push(this.center_);
  b.push(this.center_);
  var a = DMap.LonLatBounds.fromLonLatArray(b);
  this.bounds_ = this.markerClusterer_.getExtendedBounds(a);
};
Cluster.prototype.isMarkerInClusterBounds = function (a) {
  var b = a.getLonlat();
  if (this.bounds_ == null) {
    return false;
  }
  return this.bounds_.contains(a.getLonlat());
};
Cluster.prototype.getMap = function () {
  return this.map_;
};
Cluster.prototype.updateIcon = function () {
  var e = this.map_.getZoom();
  var f = this.markerClusterer_.getMaxZoom();
  if (f && e > f) {
    for (var c = 0, a; a = this._markers[c]; c++) {
      a.draw(this.map_);
    }
    return;
  }
  if (this._markers.length < this.minClusterSize_) {
    this.clusterIcon_.hide();
    return;
  }
  var d = this.markerClusterer_.getStyles().length;
  var b = this.markerClusterer_.getCalculator()(this._markers, d);
  this.clusterIcon_.setCenter(this.center_);
  this.clusterIcon_.setSums(b);
  this.clusterIcon_.show();
};

function ClusterIcon(a, c, b) {
  a.getMarkerClusterer().extend(ClusterIcon, new DMap.Overlay());
  this.styles_ = c;
  this.padding_ = b || 0;
  this.cluster_ = a;
  this.center_ = null;
  this.map_ = a.getMap();
  this.div_ = null;
  this.onAdd();
  this.sums_ = null;
  this.visible_ = false;
}

ClusterIcon.prototype.triggerClusterClick = function () {
  var a = this.cluster_.getMarkerClusterer();
  if (a.isZoomOnClick()) {
    var b = this.cluster_.getBounds();
    this.map_.setZoom(this.map_.getZoom() + 1);
  }
};
ClusterIcon.prototype.onAdd = function () {
  this.div_ = document.createElement('DIV');
  if (this.visible_) {
    var b = this.getPosFromLatLng_(this.center_);
    this.div_.style.cssText = this.createCss(b);
    this.div_.innerHTML = this.sums_.text;
  }
  document.getElementById(this.map_._panelMarkerId).appendChild(this.div_);
  var a = this;
  DMap.$(this.div_).bind('click', function () {
    a.triggerClusterClick();
  });
};
ClusterIcon.prototype.getPosFromLatLng_ = function (b) {
  var a = this.map_.fromLonLatToDivPixel(b);
  a.x -= parseInt(this.width_ / 2, 10);
  a.y -= parseInt(this.height_ / 2, 10);
  return a;
};
ClusterIcon.prototype.draw = function () {
  if (this.visible_) {
    var a = this.getPosFromLatLng_(this.center_);
    this.div_.style.top = a.y + 'px';
    this.div_.style.left = a.x + 'px';
  }
};
ClusterIcon.prototype.hide = function () {
  if (this.div_) {
    this.div_.style.display = 'none';
  }
  this.visible_ = false;
};
ClusterIcon.prototype.show = function () {
  if (this.div_) {
    var a = this.getPosFromLatLng_(this.center_);
    this.div_.style.cssText = this.createCss(a);
    this.div_.style.display = '';
  }
  this.visible_ = true;
};
ClusterIcon.prototype.remove = function () {
  this.onRemove();
};
ClusterIcon.prototype.onRemove = function () {
  if (this.div_ && this.div_.parentNode) {
    this.hide();
    this.div_.parentNode.removeChild(this.div_);
    this.div_ = null;
  }
};
ClusterIcon.prototype.setSums = function (a) {
  this.sums_ = a;
  this.text_ = a.text;
  this.index_ = a.index;
  if (this.div_) {
    this.div_.innerHTML = a.text;
  }
  this.useStyle();
};
ClusterIcon.prototype.useStyle = function () {
  var a = Math.max(0, this.sums_.index - 1);
  a = Math.min(this.styles_.length - 1, a);
  var b = this.styles_[a];
  this.url_ = b.url;
  this.height_ = b.height;
  this.width_ = b.width;
  this.textColor_ = b.textColor;
  this.anchor_ = b.anchor;
  this.textSize_ = b.textSize;
  this.backgroundPosition_ = b.backgroundPosition;
};
ClusterIcon.prototype.setCenter = function (a) {
  this.center_ = a;
};
ClusterIcon.prototype.createCss = function (e) {
  var d = [];
  if (DMap.$.browser.msie && (DMap.$.browser.version >= 5.5) && (DMap.$.browser.version < 7)) {
    d.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="' + this.url_ + '");');
  } else {
    d.push('background-image:url(' + this.url_ + ');');
  }
  var b = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';
  d.push('background-position:' + b + ';');
  if (typeof this.anchor_ === 'object') {
    if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 && this.anchor_[0] < this.height_) {
      d.push('height:' + (this.height_ - this.anchor_[0]) + 'px; padding-top:' + this.anchor_[0] + 'px;');
    } else {
      d.push('height:' + this.height_ + 'px; line-height:' + this.height_ + 'px;');
    }
    if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 && this.anchor_[1] < this.width_) {
      d.push('width:' + (this.width_ - this.anchor_[1]) + 'px; padding-left:' + this.anchor_[1] + 'px;');
    } else {
      d.push('width:' + this.width_ + 'px; text-align:center;');
    }
  } else {
    d.push('height:' + this.height_ + 'px; line-height:' + this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;');
  }
  var a = this.textColor_ ? this.textColor_ : 'black';
  var c = this.textSize_ ? this.textSize_ : 11;
  d.push('cursor:pointer; top:' + e.y + 'px; left:' + e.x + 'px; color:' + a + '; position:absolute; font-size:' + c + 'px; font-family:Arial,sans-serif; font-weight:bold');
  return d.join('');
};
DMap.Class('MultiPoint', DMap.Overlay, {
  _items: null, symbol: null, _attributes: null, initialize: function (b, c, e) {
    DMap.EhlException.isTypeRight(b, 'undefined');
    DMap.EhlException.isTypeRight(b, 'object');
    this._items = [];
    for (var a = 0; a < b.length; a++) {
      var d = b[a];
      this._items.push(new DMap.Marker(d, c));
    }
    this.symbol = {
      type: 0,
      size: new DMap.Size(32, 32),
      offsetType: 'mm',
      url: gisapi.getMarkerImageUrl('dragmarker.gif'),
      animateUrl: gisapi.getMarkerImageUrl('dragmarker_blink.gif'),
      borderWidth: 1,
      borderColor: 'red',
      color: 'white',
      opacity: 0.6,
      text: 'test',
      textFontSize: 12,
      textBorderColor: 'red',
      textBackgroundColor: 'rgb(1, 81, 144)',
      textColor: 'white',
      labelText: null,
      labelFontSize: 12,
      labelBorderColor: 'red',
      labelBackgroundColor: 'rgb(1, 81, 144)',
      labelColor: 'white'
    };
    this.setSymbol(c);
    this._attributes = e;
  }, getType: function () {
    return this.symbol.type;
  }, setType: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.type = a;
    this.setSymbol(this.symbol);
  }, getSize: function () {
    return this.symbol.size;
  }, setSize: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'DMap.Size');
    this.symbol.size = a;
    this.setSymbol(this.symbol);
  }, setOffsetType: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.offsetType = a;
    this.setSymbol(this.symbol);
  }, getOffsetType: function () {
    return this.symbol.offsetType;
  }, setUrl: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.url = a;
    this.setSymbol(this.symbol);
  }, getUrl: function () {
    return this.symbol.url;
  }, setAnimateUrl: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(_url, 'string');
    this.symbol.animateUrl = a;
    this.setSymbol(this.symbol);
  }, getAnimateUrl: function () {
    return this.symbol.animateUrl;
  }, getBorderWidth: function () {
    return this.symbol.borderWidth;
  }, setBorderWidth: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.borderWidth = a;
    this.setSymbol(this.symbol);
  }, setBorderColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.borderColor = a;
    this.setSymbol(this.symbol);
  }, getBorderColor: function () {
    return this.symbol.borderColor;
  }, setColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.color = a;
    this.setSymbol(this.symbol);
  }, getColor: function () {
    return this.symbol.color;
  }, getOpacity: function () {
    return this.symbol.opacity;
  }, setText: function (a) {
    DMap.EhlException._isNull(_color);
    DMap.EhlException.isTypeRight(_color, 'string');
    this.symblo.text = a;
    this.setSymbol(this.symbol);
  }, getText: function () {
    return this.symbol.text;
  }, setTextFontSize: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.textFontSize = a;
    this.setSymbol(this.symbol);
  }, getTextFontSize: function () {
    return this.symbol.textFontSize;
  }, setTextBackgroundColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.textBackgroundColor = a;
    this.setSymbol(this.symbol);
  }, getTextBackgroundColor: function () {
    return this.symbol.textBackgroundColor;
  }, setTextColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.textColor = a;
  }, getTextColor: function () {
    return this.symbol.textColor;
  }, setLabelText: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelText = a;
    this.setSymbol(this.symbol);
  }, getLabelText: function () {
    return this.symbol.labelText;
  }, setLabelFontSize: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'number');
    this.symbol.labelFontSize = a;
    this.setSymbol(this.symbol);
  }, getLabelFontSize: function () {
    return this.symbol.labelFontSize;
  }, setLabelBorderColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelBorderColor = a;
    this.setSymbol(this.symbol);
  }, getLabelBorderColor: function () {
    return this.symbol.labelBorderColor;
  }, setLabelBackgroundColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelBackgroundColor = a;
    this.setSymbol(this.symbol);
  }, getLabelBackgroundColor: function () {
    return this.symbol.labelBackgroundColor;
  }, setLabelColor: function (a) {
    DMap.EhlException._isNull(a);
    DMap.EhlException.isTypeRight(a, 'string');
    this.symbol.labelColor = a;
    this.setSymbol(this.symbol);
  }, getLabelColor: function () {
    return this.symbol.labelColor;
  }, getDoms: function () {
    var c = [];
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      c = c.concat(b.getDoms());
    }
    return c;
  }, draw: function (c) {
    this._map = c;
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.draw(c);
    }
  }, redraw: function (c) {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.redraw(c);
    }
  }, remove: function () {
    this.clearEvent();
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.remove();
    }
  }, setSymbol: function (c) {
    this.symbol = DMap.$.extend(this.symbol, c || {});
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      b.setSymbol(this.symbol);
    }
  }, getSymbol: function () {
    return DMap.$.extend({}, this.symbol);
  }, setAttributes: function (a) {
    this._attributes = DMap.$.extend(this._attributes, a);
  }, getAttributes: function () {
    return DMap.$.extend({}, this._attributes);
  }, getLonLats: function () {
    var a = [];
    for (var b = 0; b < this._items.length; b++) {
      var c = this._items[b];
      a.push(c.getLonlat());
    }
    return a;
  }, setCommonEvent: function () {
    var c = this;
    c.clearEvent();
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      DMap.$([b._dom, b._labelDom]).bind('mousedown', function () {
        return false;
      }).bind('mouseenter', function (d) {
        DMap.$(c).trigger('mouseover');
        return false;
      }).bind('mouseleave', function (d) {
        DMap.$(c).trigger('mouseout');
        return false;
      }).bind('click', function (d) {
        DMap.$(c).trigger('click');
        return false;
      }).bind('contextmenu', function (d) {
        DMap.$(c).trigger('rightclick');
        return false;
      }).css('cursor', 'pointer');
    }
    return this;
  }, clearEvent: function () {
    for (var a = 0; a < this._items.length; a++) {
      var b = this._items[a];
      DMap.$(b._dom).unbind().css('cursor', '');
      if (b._labelDom) {
        DMap.$(b._labelDom).unbind().css('cursor', '');
      }
    }
    return this;
  }, addAnimate: function (b, a) {
    var d;
    this.setSymbol(b);
    var c = this.symbol.color;
    this.setCommonEvent();
    DMap.$(this).bind('mouseover.animate', function () {
      var e = this;
      d = setInterval(function () {
        if (e.symbol.color != e.symbol.animateFromColor) {
          e.setSymbol({color: e.symbol.animateFromColor});
        } else {
          e.setSymbol({color: e.symbol.animateColor});
        }
      }, a);
    });
    DMap.$(this).bind('mouseout.animate', function () {
      clearInterval(d);
      this.setSymbol({color: c});
    });
  }, removeAnimate: function () {
    DMap.$(this).unbind('mouseover.animate');
  }
});
DMap.MultiPoint.clone = function (a) {
  return new DMap.MultiPoint(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.MultiPoint.printable = true;
DMap.Class('KmlMetadata', {
  callback: function (a) {
  }, initialize: function (a) {
    DMap.Util.extend(this, a);
    this.options = a;
    if (this.options.callback) {
      this.callback = this.options.callback;
    }
  }, read: function (e, f, b, a, d) {
    var c = this;
    var g = {};
    g.proxyurl = e;
    DMap.$.ajax({
      url: '../DcProxy',
      data: g,
      type: 'post',
      async: false,
      dataType: 'xml',
      cache: false,
      success: function (A) {
        var r = [];
        if (DMap.$(A).find('LineString').length > 0) {
          var w, n;
          var x, y;
          DMap.$(A).find('Style').each(function () {
            if (DMap.$(this).attr('id') == 'kml_style_normal') {
              w = DMap.$(this).find('LineStyle').children('color').text();
              n = DMap.$(this).find('LineStyle').children('width').text();
            }
            if (DMap.$(this).attr('id') == 'kml_style_highlight') {
              x = DMap.$(this).find('LineStyle').children('color').text();
              y = DMap.$(this).find('LineStyle').children('width').text();
            }
          });
          var q = {_defaultColor: w, _defaultWith: n, _hignColor: x, _hignWith: y};
          DMap.$(A).find('Placemark').each(function () {
            var C = DMap.$(this).children('name').text();
            var D = DMap.$(this).children('description').text();
            var E = DMap.$(this).find('LineString').children('LineStringSimpleExtensionGroup').text();
            var B = {_name: C, _coordinates: E, _description: D};
            r.push(c.drawKMLLine(q, B, b, a));
          });
        }
        if (DMap.$(A).find('Polygon').length > 0) {
          var k, h, s, v;
          var j, u, z;
          DMap.$(A).find('Style').each(function () {
            if (DMap.$(this).attr('id') == 'kml_style_normal') {
              k = DMap.$(this).find('LineStyle').children('color').text();
              h = DMap.$(this).find('LineStyle').children('width').text();
              s = DMap.$(this).find('PolyStyle').children('color').text();
            }
            if (DMap.$(this).attr('id') == 'kml_style_highlight') {
              j = DMap.$(this).find('LineStyle').children('color').text();
              u = DMap.$(this).find('LineStyle').children('width').text();
              z = DMap.$(this).find('PolyStyle').children('color').text();
            }
          });
          DMap.$(A).find('Data').each(function () {
            if (DMap.$(this).attr('name') == 'fillOpacity') {
              v = DMap.$(this).children('value').text();
            }
          });
          var o = {
            lineColor: k,
            lineWidth: h,
            polygonColor: s,
            hignLineColor: j,
            hignWidth: u,
            hignPolygonColor: z,
            fillOpacity: v
          };
          DMap.$(A).find('Placemark').each(function () {
            var C = DMap.$(this).children('name').text();
            var D = DMap.$(this).children('description').text();
            var E = DMap.$(this).find('Polygon').children('PolygonSimpleExtensionGroup').text();
            var B = {_name: C, _coordinates: E, _description: D};
            r.push(c.drawKMLPloygon(o, B, b, a));
          });
        }
        if (DMap.$(A).find('Point').length > 0) {
          var p;
          var l;
          var t;
          DMap.$(A).find('Style').each(function () {
            if (DMap.$(this).attr('id') == 'kml_style_normal') {
              p = DMap.$(this).find('IconStyle').find('Icon').children('href').text();
            }
            if (DMap.$(this).attr('id') == 'kml_style_highlight') {
              l = DMap.$(this).find('IconStyle').find('Icon').children('href').text();
              t = DMap.$(this).find('IconStyle').find('scale').text();
            }
          });
          var i = {_iconUrl: p, _hginUrl: l, _hignBs: t};
          DMap.$(A).find('Placemark').each(function (D) {
            var C = DMap.$(this).children('name').text();
            var E = DMap.$(this).children('description').text();
            var F = DMap.$(this).find('Point').children('PointSimpleExtensionGroup').text();
            var B = {_name: C, _description: E, _coordinates: F};
            var G = c.drawKMLMark(i, B, b, a, d);
            r.push(G);
          });
        }
        c.callback(r);
        var m = new Date();
        if (d) {
        }
        if (r.length > 0) {
          f.resume();
        }
      }
    });
  }, drawKMLMark: function (j, g, b, c, d) {
    var h = this;
    var k = DMap.Util.wkt2lonlatArray(g._coordinates)[0];
    var f = {type: 0, size: new DMap.Size(16, 16), url: j._iconUrl};
    var e = DMap.Overlay.createByWKT(g._coordinates, f);
    e.setCommonEvent();
    e.name = g._name;
    e.point = k;
    e.setMinZoom(b);
    e.setMaxZoom(c);
    var l = {type: 0, size: new DMap.Size(32 * j._hignBs, 32 * j._hignBs), animateUrl: j._hginUrl};
    e.addAnimate(l);
    var a = {size: new DMap.Size(200, 200), isAdjustPositon: true, offsetSize: new DMap.Size(0, 0)};
    var i = '<table><tr style=\'borderColor:1\'><td></td></tr><tr><td>' + g._description + '</td></tr></table>';
    DMap.$(e).bind('click', function (m) {
      map.openInfoWindowHtml(k, i, a);
    }).bind('mouseover', function (m) {
      map.showFloatHelper(this.name);
    }).bind('mouseout', function (m) {
      map.hideFloatHelper();
    });
    if (!d) {
      map.addOverlay(e);
    }
    return e;
  }, drawKMLLine: function (h, g, e, d) {
    var c = g._coordinates;
    var a = DMap.Overlay.createByWKT(c, {color: h._defaultColor, weight: h._defaultWith, animateFromColor: 'red'});
    a.setCommonEvent();
    a.setMinZoom(e);
    a.setMaxZoom(d);
    var f = {animateFromColor: h._hignColor, weight: h._hignWith};
    a.setAnimate(true);
    a.addAnimate(f, 100);
    var b = {size: new DMap.Size(200, 200), isAdjustPositon: true, offsetSize: new DMap.Size(0, 0)};
    DMap.$(a).bind('click', function (i) {
      map.openInfoWindowHtml(DMap.Util.wkt2lonlatArray(c)[0], g._description, b);
    });
    map.addOverlay(a);
    return a;
  }, drawKMLPloygon: function (a, h, g, f) {
    var e = h._coordinates;
    var c = DMap.Overlay.createByWKT(e, {
      color: a.lineColor,
      fillColor: a.polygonColor,
      weight: a.lineWidth,
      fillOpacity: a.fillOpacity
    });
    var d = {animateFromColor: a.hignLineColor, weight: a.hignWidth};
    var b = {size: new DMap.Size(200, 100), isAdjustPositon: true, offsetSize: new DMap.Size(0, 0)};
    c.setCommonEvent();
    c.addAnimate(d);
    c.setMinZoom(g);
    c.setMaxZoom(f);
    DMap.$(c).bind('click', function (i) {
      map.openInfoWindowHtml(c.getLonLats()[0], h._name, b);
    });
    map.addOverlay(c);
    return c;
  }
});
DMap.Class('ToolBarHelper', DMap.Control, {
  _map: null,
  _mouseDivId: null,
  _resultOverlay: null,
  _mouseTrackPolyline1: null,
  _mouseTrackPolyline2: null,
  initialize: function () {
  },
  draw: function (b) {
    this._map = b;
    this._mouseDivId = DMap.Util.createUniqueID();
    var a = this._map.getSize();
    var c = DMap.Util.createDiv({id: this._mouseDivId}, {
      background: 'rgb(0, 0, 0) none repeat scroll 0% 0%',
      overflow: 'hidden',
      position: 'absolute',
      left: '0px',
      top: '0px',
      width: a.w + 'px',
      height: a.h + 'px',
      zIndex: '0',
      cursor: 'crosshair',
      display: 'block',
      opacity: '0'
    });
    DMap.$(c).attr('unselectable', 'on');
    document.getElementById(this._map._viewportId).appendChild(c);
    this.deactivate();
  },
  remove: function () {
    DMap.$(this._map).unbind('.ToolBarHelper');
    this._map = null;
  },
  deactivate: function () {
    DMap.$get(this._mouseDivId).unbind('.ToolBarHelper').css('display', 'none');
    this._clearMouseTrack();
    DMap.$(this._map).unbind('.ToolBarHelper');
    DMap.$(document).unbind('.ToolBarHelper');
    this._map._customEventClass = '';
    this._map.hideFloatHelper();
    DMap.$(this).unbind('end');
    this._map._enableDragPan = true;
    this._map.setCursor('url(' + gisapi.getCursorsUrl('closedhand.cur') + ')');
  },
  _clearMouseTrack: function () {
    if (this._resultOverlay) {
      this._map.removeOverlay(this._resultOverlay);
      this._resultOverlay = null;
    }
    if (this._mouseTrackPolyline1) {
      this._map.removeOverlay(this._mouseTrackPolyline1);
      this._mouseTrackPolyline1 = null;
    }
    if (this._mouseTrackPolyline2) {
      this._map.removeOverlay(this._mouseTrackPolyline2);
      this._mouseTrackPolyline2 = null;
    }
  },
  activate: function (a, c) {
    this.deactivate();
    var b = this;
    DMap.$(b._map).bind('mousemove.ToolBarHelper', function (f, d) {
      switch (a) {
        case'POINT':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_PointQuery.cur') + ')');
          break;
        case'LINE':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('crosshairs.cur') + ')');
          break;
        case'POLYLINE':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('crosshairs.cur') + ')');
          break;
        case'POLYGON':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_PolygonQuery.cur') + ')');
          break;
        case'REC':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_RectQuery.cur') + ')');
          break;
        case'ZOOMIN':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('MoveZoomIn.cur') + ')');
          break;
        case'ZOOMOUT':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('MoveZoomOut.cur') + ')');
          break;
        case'ARCTIVEMEASURE':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('MeasureLength.cur') + ')');
          break;
        case'ARCTIVEAREA':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('MeasureArea.cur') + ')');
          break;
        case'ROUND':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_CircleQuery.cur') + ')');
          break;
        case'CURVE':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('crosshairs.cur') + ')');
          break;
        case'ELLIPSE':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_CircleQuery.cur') + ')');
          break;
        case'TRIANGLE':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_PolygonQuery.cur') + ')');
          break;
        case'SECTOR':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_PolygonQuery.cur') + ')');
          break;
        case'ROUNDRECT':
          b._map.setCursor('url(' + gisapi.getCursorsUrl('cur_PolygonQuery.cur') + ')');
          break;
        default:
          b._map.setCursor('crosshair');
      }
    });
    DMap.$(b._map).bind('drag.ToolBarHelper', function (f, d) {
      b._map.setCursor('url(' + gisapi.getCursorsUrl('closedhand.cur') + '),, default');
    });
    switch (a) {
      case'POINT':
        this._drawPoint(c);
        break;
      case'LINE':
        this._drawLine(c);
        break;
      case'ARCTIVEMEASURE':
      case'POLYLINE':
        this._drawPolyline(c);
        break;
      case'ARCTIVEAREA':
      case'POLYGON':
        this._drawPolygon(c);
        break;
      case'ZOOMIN':
      case'ZOOMOUT':
      case'REC':
        this._drawRec(c);
        break;
      case'ROUND':
        this._drawRound(c);
        break;
      case'ACTION':
        this._drawAction(c);
        break;
      case'TWOACTION':
        this._drawAction(c, 2);
        break;
      case'CURVE':
        this._drawCurve(c);
        break;
      case'ELLIPSE':
        this._drawEllipse(c);
        break;
      case'TRIANGLE':
        this._drawTriangle(c);
        break;
      case'SECTOR':
        this._drawSector(c);
        break;
      case'ROUNDRECT':
        this._drawRoundRect(c);
        break;
      default:
        alert('geometryType is not implements');
    }
  },
  bindCallback: function (a) {
    this.fn = a;
    DMap.$(this).unbind('end');
    DMap.$(this).bind('end', this.fn);
  },
  endDraw: function (a) {
    DMap.$(this).trigger('end', [a]);
    this._clearMouseTrack();
    this._map._enableDragPan = true;
  },
  _drawPoint: function (b) {
    var a = this;
    var c = DMap.$.extend({}, gisapi.ToolBarHelper_drawPoint_tooltip);
    b = DMap.$.extend(c, b);
    a._map.showFloatHelper(b.start);
    a._map._customEventClass = 'ToolBarHelper';
    DMap.$(a._map).bind('click.ToolBarHelper', function (g, d, f) {
      a.endDraw(f);
    });
  },
  _drawLine: function (b) {
    var a = this;
    var c = DMap.$.extend({}, gisapi.ToolBarHelper_drawLine_tooltip);
    b = DMap.$.extend(c, b);
    a._map.showFloatHelper(b.start);
    a._map._customEventClass = 'ToolBarHelper';
    DMap.$(a._map).bind('mousemove.ToolBarHelper', function (f, d) {
      if (a._resultOverlay) {
        a._resultOverlay.updateVertex(1, d);
      }
    });
    DMap.$(a._map).bind('click.ToolBarHelper', function (g, d, f) {
      if (a._resultOverlay) {
        a._map.showFloatHelper(b.start);
        a._resultOverlay.insertVertex(a._resultOverlay.getVertexCount(), f);
        a.endDraw(a._resultOverlay.getLonLats());
      } else {
        a._resultOverlay = new DMap.Polyline([]);
        a._map.addOverlay(a._resultOverlay);
        a._resultOverlay.insertVertex(a._resultOverlay.getVertexCount(), f);
        a._map.showFloatHelper(b.end);
      }
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (d) {
      a.activate('LINE', b);
      a.bindCallback(a.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (d) {
      if (d.keyCode == '27') {
        a.activate('LINE', b);
        a.bindCallback(a.fn);
      }
    });
  },
  _drawPolyline: function (e) {
    var d = this;
    var f = DMap.$.extend({}, gisapi.ToolBarHelper_drawPolyline_tooltip);
    e = DMap.$.extend(f, e);
    d._map.showFloatHelper(e.start);
    d._map._customEventClass = 'ToolBarHelper';
    var b = false;
    var c = false;
    var a = false;
    var g = false;
    DMap.$(d._map).bind('mousedown.ToolBarHelper', function (i, h) {
      g = true;
      if (!d._resultOverlay) {
        if (!c) {
          b = true;
          i.stopPropagation();
        }
        d._resultOverlay = new DMap.Polyline([]);
        d._map.addOverlay(d._resultOverlay);
        d._mouseTrackPolyline1 = new DMap.Polyline([]);
        d._map.addOverlay(d._mouseTrackPolyline1);
        d._map.showFloatHelper(e.move);
        b = true;
        d._map._enableDragPan = false;
      } else {
        d._map._enableDragPan = true;
        if (!c) {
          return;
        }
      }
      d._mouseTrackPolyline1.updateVertex(0, h);
      d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
    });
    DMap.$(document).bind('mouseup.ToolBarHelper', function (i) {
      if (!g) {
        return;
      }
      if (i.which != 1) {
        return;
      }
      var h = d._map.fromMouseEventToLonLat(i);
      if (c) {
        d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
        d.endDraw(d._resultOverlay.getLonLats());
      } else {
        if (!a) {
          d._mouseTrackPolyline1.updateVertex(0, h);
          d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
        }
      }
      c = false;
      a = false;
      g = false;
      b = false;
    });
    DMap.$(d._map).bind('mousemove.ToolBarHelper', function (i, h) {
      if (g) {
        a = true;
      }
      if (b) {
        c = true;
        d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
      } else {
        if (d._mouseTrackPolyline1) {
          d._mouseTrackPolyline1.updateVertex(1, h);
        }
      }
    });
    DMap.$(d._map).bind('dblclick.ToolBarHelper', function (j, h, i) {
      if (d._resultOverlay.getLonLats() == null) {
        return;
      }
      if (d._resultOverlay.getLonLats().length < 2) {
        return;
      }
      b = false;
      c = false;
      d.endDraw(d._resultOverlay.getLonLats());
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (h) {
      d.activate('POLYLINE', e);
      d.bindCallback(d.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (h) {
      if (h.keyCode == '27') {
        d.activate('POLYLINE', e);
        d.bindCallback(d.fn);
      }
    });
  },
  _drawPolygon: function (g) {
    var e = this;
    e._map._enableDragPan = false;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawPolygon_tooltip);
    g = DMap.$.extend(h, g);
    e._map.showFloatHelper(g.start);
    e._map._customEventClass = 'ToolBarHelper';
    var a = false;
    var c = false;
    var f = false;
    var d = false;
    DMap.$(e._map).bind('mousedown.ToolBarHelper', function (i, b) {
      d = false;
      if (e._resultOverlay) {
        e._map.showFloatHelper(g.end);
        e._map._enableDragPan = true;
        if (!c) {
          return false;
        }
      } else {
        a = true;
        i.stopPropagation();
        e._resultOverlay = new DMap.Polygon([]);
        e._map.addOverlay(e._resultOverlay);
        e._mouseTrackPolyline1 = new DMap.Polyline([]);
        e._map.addOverlay(e._mouseTrackPolyline1);
        e._mouseTrackPolyline2 = new DMap.Polyline([]);
        e._map.addOverlay(e._mouseTrackPolyline2);
        e._mouseTrackPolyline2.updateVertex(0, b);
        e._map.showFloatHelper(g.move);
        e._map._enableDragPan = false;
      }
      e._mouseTrackPolyline1.updateVertex(0, b);
      e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
      return false;
    });
    DMap.$(document).bind('mouseup.ToolBarHelper', function (i) {
      if (i.which != 1) {
        return;
      }
      var b = e._map.fromMouseEventToLonLat(i);
      if (c) {
        e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
        e.endDraw(e._resultOverlay.getLonLats());
        e._map.showFloatHelper(g.start);
        c = false;
      } else {
        if (e._resultOverlay && !f) {
          e._mouseTrackPolyline1.updateVertex(0, b);
          e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
        }
      }
      a = false;
      d = true;
    });
    DMap.$(e._map).bind('mousemove.ToolBarHelper', function (i, b) {
      if (e._mouseTrackPolyline1) {
        e._mouseTrackPolyline1.updateVertex(1, b);
      }
      if (e._mouseTrackPolyline2) {
        e._mouseTrackPolyline2.updateVertex(1, b);
      }
    });
    DMap.$(e._map).bind('dblclick.ToolBarHelper', function (j, b, i) {
      if (e._resultOverlay.getLonLats().length < 3) {
        return;
      }
      e._map.showFloatHelper(g.start);
      a = false;
      c = false;
      e.endDraw(e._resultOverlay.getLonLats());
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      e.activate('POLYGON', g);
      e.bindCallback(e.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == '27') {
        e.activate('POLYGON', g);
        e.bindCallback(e.fn);
      }
    });
  },
  _drawRec: function (g) {
    var f = this;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawRec_tooltip);
    g = DMap.$.extend(h, g);
    var j = null;
    f._map.showFloatHelper(g.start);
    f._drawing = 'REC';
    var a = false;
    var d = false;
    DMap.$(f._map).bind('mousedown.ToolBarHelper', function (c, b) {
      f._map._enableDragPan = false;
      if (!f._resultOverlay) {
        if (!d) {
          a = true;
          c.stopPropagation();
        }
        j = b;
        f._resultOverlay = new DMap.Polygon([b]);
        f._map.addOverlay(f._resultOverlay);
      } else {
        f._map._enableDragPan = true;
      }
      e = true;
    });
    var e = true;
    DMap.$(document).bind('mousemove.ToolBarHelper', function (c) {
      if (f._drawing != 'REC') {
        return;
      }
      if (f._map._enableDragPan) {
        e = false;
      }
      var b = f._map.fromMouseEventToLonLat(c);
      if (a) {
        d = true;
        f._map.showFloatHelper(g.end);
        a = false;
      }
      if (f._resultOverlay) {
        f._resultOverlay.updateVertex(1, new DMap.LonLat(b.lon, j.lat));
        f._resultOverlay.updateVertex(2, b);
        f._resultOverlay.updateVertex(3, new DMap.LonLat(j.lon, b.lat));
        f._resultOverlay.updateVertex(4, j);
      }
    });
    var i = true;
    DMap.$(document).bind('mouseup.ToolBarHelper', function (b) {
      if (b.which != 1) {
        return;
      }
      if (f._drawing != 'REC') {
        return;
      }
      a = false;
      if (f._resultOverlay && !d && i) {
        f._map.showFloatHelper(g.end);
        i = false;
        return;
      }
      if (f._resultOverlay && e) {
        f._map.showFloatHelper(g.start);
        f.endDraw(f._resultOverlay.getLonLats());
        i = true;
        d = false;
      }
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      f.activate('REC', g);
      f.bindCallback(f.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == '27') {
        f.activate('REC', g);
        f.bindCallback(f.fn);
      }
    });
  },
  _drawRound: function (g) {
    var f = this;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawRound_tooltip);
    g = DMap.$.extend(h, g);
    f._map.showFloatHelper(g.start);
    f._map._customEventClass = 'ToolBarHelper';
    f._drawing = 'ROUND';
    var a = false;
    var d = false;
    DMap.$(f._map).bind('mousedown.ToolBarHelper', function (c, b) {
      f._map._enableDragPan = false;
      if (!f._resultOverlay) {
        if (!d) {
          a = true;
          c.stopPropagation();
        }
        f._resultOverlay = new DMap.Round([b, 2]);
        f._map.addOverlay(f._resultOverlay);
        f._map.showFloatHelper(g.end);
      } else {
        f._map._enableDragPan = true;
      }
      e = true;
      c.preventDefault();
    });
    var e = true;
    var i = true;
    DMap.$(document).bind('mouseup.ToolBarHelper', function (k) {
      if (k.which != 1) {
        return;
      }
      a = false;
      if (f._drawing != 'ROUND') {
        return;
      }
      if (f._resultOverlay && !d && i) {
        i = false;
        return;
      }
      var j = f._map.fromMouseEventToLonLat(k);
      if (f._resultOverlay && e) {
        f._map.showFloatHelper(g.start);
        var b = f._resultOverlay.getLonlatAndR()[0];
        var c = Math.sqrt((Math.pow((j.lon - b.lon), 2)) + Math.pow((j.lat - b.lat), 2));
        f._resultOverlay.setLonlatAndR([b, c]);
        d = false;
        a = false;
        i = true;
        f.endDraw(f._resultOverlay.getLonlatAndR());
      }
    });
    DMap.$(f._map).bind('mousemove.ToolBarHelper', function (j, c) {
      if (f._drawing != 'ROUND') {
        return;
      }
      if (a) {
        a = false;
        d = true;
        f._map.showFloatHelper(g.move);
      }
      if (f._map._enableDragPan) {
        e = false;
      }
      if (f._resultOverlay) {
        var b = f._resultOverlay.getLonlatAndR()[0];
        f._resultOverlay.setLonlatAndR([b, DMap.Util.measureDistance([c, b])]);
      }
      j.preventDefault();
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      f.activate('ROUND', g);
      f.bindCallback(f.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == '27') {
        f.activate('ROUND', g);
        f.bindCallback(f.fn);
      }
    });
  },
  _drawAction: function (c, b) {
    var a = this;
    a._map._enableDragPan = false;
    var d = DMap.$.extend({}, gisapi.ToolBarHelper_drawAction_tooltip);
    c = DMap.$.extend(d, c);
    a._map.showFloatHelper(c.start);
    a._map._customEventClass = 'ToolBarHelper';
    DMap.$(a._map).bind('mousedown.ToolBarHelper', function (k, j) {
      down = true;
      var i = a._map.fromLonLatToDivPixel(j);
      var h = new DMap.Pixel(i.x - 100, i.y);
      var g = new DMap.Pixel(i.x + 100, i.y + 100);
      var f = new DMap.Pixel((h.x + g.x) / 2 + 100, i.y - 100);
      var p = new DMap.Pixel(i.x, i.y);
      var l = [];
      l.push(a._map.fromDivPixelToLonLat(h));
      l.push(a._map.fromDivPixelToLonLat(g));
      l.push(a._map.fromDivPixelToLonLat(f));
      l.push(a._map.fromDivPixelToLonLat(p));
      if (b) {
        var o = new DMap.Pixel(h.x, h.y - 50);
        var n = new DMap.Pixel(p.x, p.y - 50);
        var m = new DMap.Pixel(p.x, (p.y + n.y) / 2);
        l.push(a._map.fromDivPixelToLonLat(o));
        l.push(a._map.fromDivPixelToLonLat(n));
        l.push(a._map.fromDivPixelToLonLat(m));
      }
      a._resultOverlay = new DMap.ActionArrow(l, {weight: 0.5, fillColor: 'red', fillColor2: 'blue'});
      a._resultOverlay.setCommonEvent();
      DMap.$(a._resultOverlay).bind('click', function (r, q) {
        if (a._resultOverlay) {
          a._resultOverlay.enableEditing();
        }
      });
      map.addOverlay(a._resultOverlay);
      a.endDraw(a._resultOverlay.getLonLats());
    });
  },
  _drawCurve: function (e) {
    var d = this;
    var f = DMap.$.extend({}, gisapi.ToolBarHelper_drawCurveLine_tooltip);
    e = DMap.$.extend(f, e);
    d._map.showFloatHelper(e.start);
    d._map._customEventClass = 'ToolBarHelper';
    var b = false;
    var c = false;
    var a = false;
    var g = false;
    DMap.$(d._map).bind('mousedown.ToolBarHelper', function (i, h) {
      g = true;
      if (!d._resultOverlay) {
        if (!c) {
          b = true;
          i.stopPropagation();
        }
        d._resultOverlay = new DMap.CurveLine([]);
        d._map.addOverlay(d._resultOverlay);
        d._mouseTrackPolyline1 = new DMap.CurveLine([]);
        d._map.addOverlay(d._mouseTrackPolyline1);
        d._map.showFloatHelper(e.move);
        b = true;
        d._map._enableDragPan = false;
      } else {
        d._map._enableDragPan = true;
        if (!c) {
          return;
        }
      }
      d._mouseTrackPolyline1.updateVertex(0, h);
      d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
    });
    DMap.$(document).bind('mouseup.ToolBarHelper', function (i) {
      if (!g) {
        return;
      }
      if (i.which != 1) {
        return;
      }
      var h = d._map.fromMouseEventToLonLat(i);
      if (c) {
        d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
        d.endDraw(d._resultOverlay.getLonLats());
        d._map.showFloatHelper(e.start);
      } else {
        if (!a) {
          d._mouseTrackPolyline1.updateVertex(0, h);
          d._resultOverlay.insertVertex(d._resultOverlay.getVertexCount(), h);
        }
      }
      c = false;
      a = false;
      g = false;
      b = false;
    });
    DMap.$(d._map).bind('mousemove.ToolBarHelper', function (i, h) {
      if (d._mouseTrackPolyline1) {
        d._mouseTrackPolyline1.updateVertex(1, h);
      }
    });
    DMap.$(d._map).bind('dblclick.ToolBarHelper', function (j, h, i) {
      if (d._resultOverlay.getLonLats() == null) {
        return;
      }
      if (d._resultOverlay.getLonLats().length < 2) {
        return;
      }
      b = false;
      c = false;
      d.endDraw(d._resultOverlay.getLonLats());
      d._map.showFloatHelper(e.start);
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (h) {
      d.activate('CURVE', e);
      d.bindCallback(d.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (h) {
      if (h.keyCode == '27') {
        d.activate('CURVE', e);
        d.bindCallback(d.fn);
      }
    });
  },
  _drawEllipse: function (g) {
    var f = this;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawEllipse_tooltip);
    g = DMap.$.extend(h, g);
    f._map.showFloatHelper(g.start);
    f._map._customEventClass = 'ToolBarHelper';
    f._drawing = 'ELLIPSE';
    var a = false;
    var d = false;
    DMap.$(f._map).bind('mousedown.ToolBarHelper', function (c, b) {
      f._map._enableDragPan = false;
      if (!f._resultOverlay) {
        if (!d) {
          a = true;
          c.stopPropagation();
        }
        f._resultOverlay = new DMap.Ellipse([b, new DMap.LonLat(120.45, 30.667)]);
        f._map.addOverlay(f._resultOverlay);
        f._map.showFloatHelper(g.end);
      } else {
        f._map._enableDragPan = true;
      }
      e = true;
      c.preventDefault();
    });
    var e = true;
    var i = true;
    DMap.$(document).bind('mouseup.ToolBarHelper', function (j) {
      if (j.which != 1) {
        return;
      }
      a = false;
      if (f._drawing != 'ELLIPSE') {
        return;
      }
      if (f._resultOverlay && !d && i) {
        i = false;
        return;
      }
      var c = f._map.fromMouseEventToLonLat(j);
      if (f._resultOverlay && e) {
        f._map.showFloatHelper(g.start);
        var b = f._resultOverlay.getLonLats()[0];
        f._resultOverlay.setLonlats([b, c]);
        d = false;
        a = false;
        i = true;
        f.endDraw(f._resultOverlay.getLonLats());
      }
    });
    DMap.$(f._map).bind('mousemove.ToolBarHelper', function (j, c) {
      if (f._drawing != 'ELLIPSE') {
        return;
      }
      if (a) {
        a = false;
        d = true;
        f._map.showFloatHelper(g.move);
      }
      if (f._map._enableDragPan) {
        e = false;
      }
      if (f._resultOverlay) {
        var b = f._resultOverlay.getLonLats()[0];
        f._resultOverlay.setLonlats([b, c]);
      }
      j.preventDefault();
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      f.activate('ELLIPSE', g);
      f.bindCallback(f.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == '27') {
        f.activate('ELLIPSE', g);
        f.bindCallback(f.fn);
      }
    });
  },
  _drawTriangle: function (g) {
    var e = this;
    e._map._enableDragPan = false;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawTriangle_tooltip);
    g = DMap.$.extend(h, g);
    e._map.showFloatHelper(g.start);
    e._map._customEventClass = 'ToolBarHelper';
    var a = false;
    var c = false;
    var f = false;
    var d = false;
    DMap.$(e._map).bind('mousedown.ToolBarHelper', function (i, b) {
      d = false;
      if (e._resultOverlay) {
        e._map.showFloatHelper(g.end);
        e._map._enableDragPan = true;
        if (!c) {
          return false;
        }
      } else {
        a = true;
        i.stopPropagation();
        e._resultOverlay = new DMap.Polygon([]);
        e._map.addOverlay(e._resultOverlay);
        e._mouseTrackPolyline1 = new DMap.Polyline([]);
        e._map.addOverlay(e._mouseTrackPolyline1);
        e._mouseTrackPolyline2 = new DMap.Polyline([]);
        e._map.addOverlay(e._mouseTrackPolyline2);
        e._mouseTrackPolyline2.updateVertex(0, b);
        e._map.showFloatHelper(g.move);
        e._map._enableDragPan = false;
      }
      e._mouseTrackPolyline1.updateVertex(0, b);
      e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
      return false;
    });
    DMap.$(document).bind('mouseup.ToolBarHelper', function (i) {
      if (i.which != 1) {
        return;
      }
      var b = e._map.fromMouseEventToLonLat(i);
      if (c) {
        e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
        e.endDraw(e._resultOverlay.getLonLats());
        e._map.showFloatHelper(g.start);
        c = false;
      } else {
        if (e._resultOverlay && !f) {
          e._mouseTrackPolyline1.updateVertex(0, b);
          if (e._resultOverlay.getVertexCount().length == 3) {
            return;
          }
          e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
        }
      }
      a = false;
      d = true;
    });
    DMap.$(e._map).bind('mousemove.ToolBarHelper', function (i, b) {
      if (e._mouseTrackPolyline1) {
        e._mouseTrackPolyline1.updateVertex(1, b);
      }
      if (e._mouseTrackPolyline2) {
        e._mouseTrackPolyline2.updateVertex(1, b);
      }
    });
    DMap.$(e._map).bind('dblclick.ToolBarHelper', function (j, b, i) {
      if (e._resultOverlay.getLonLats().length == 4) {
        e._map.showFloatHelper(g.start);
        a = false;
        c = false;
        e.endDraw(e._resultOverlay.getLonLats());
      } else {
        alert(gisapi.ToolBarHelper_alowTreePoint);
        return;
      }
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      e.activate('TRIANGLE', g);
      e.bindCallback(e.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == '27') {
        e.activate('TRIANGLE', g);
        e.bindCallback(e.fn);
      }
    });
  },
  _drawSector: function (g) {
    var e = this;
    e._map._enableDragPan = false;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawSector_tooltip);
    g = DMap.$.extend(h, g);
    e._map.showFloatHelper(g.start);
    e._map._customEventClass = 'ToolBarHelper';
    var a = false;
    var c = false;
    var f = false;
    var d = false;
    DMap.$(e._map).bind('mousedown.ToolBarHelper', function (i, b) {
      d = false;
      if (e._resultOverlay) {
        e._map.showFloatHelper(g.end);
        e._map._enableDragPan = true;
        if (!c) {
          return false;
        }
      } else {
        a = true;
        i.stopPropagation();
        e._resultOverlay = new DMap.Triangle([]);
        e._map.addOverlay(e._resultOverlay);
        e._mouseTrackPolyline1 = new DMap.Polyline([]);
        e._map.addOverlay(e._mouseTrackPolyline1);
        e._mouseTrackPolyline2 = new DMap.Polyline([]);
        e._map.addOverlay(e._mouseTrackPolyline2);
        e._mouseTrackPolyline2.updateVertex(0, b);
        e._map.showFloatHelper(g.move);
        e._map._enableDragPan = false;
      }
      e._mouseTrackPolyline1.updateVertex(0, b);
      e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
      return false;
    });
    DMap.$(document).bind('mouseup.ToolBarHelper', function (i) {
      if (i.which != 1) {
        return;
      }
      var b = e._map.fromMouseEventToLonLat(i);
      if (c) {
        e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
        e.endDraw(e._resultOverlay.getLonLats());
        e._map.showFloatHelper(g.start);
        c = false;
      } else {
        if (e._resultOverlay && !f) {
          e._mouseTrackPolyline1.updateVertex(0, b);
          if (e._resultOverlay.getVertexCount().length == 3) {
            return;
          }
          e._resultOverlay.insertVertex(e._resultOverlay.getVertexCount(), b);
        }
      }
      a = false;
      d = true;
    });
    DMap.$(e._map).bind('mousemove.ToolBarHelper', function (i, b) {
      if (e._mouseTrackPolyline1) {
        e._mouseTrackPolyline1.updateVertex(1, b);
      }
      if (e._mouseTrackPolyline2) {
        e._mouseTrackPolyline2.updateVertex(1, b);
      }
    });
    DMap.$(e._map).bind('dblclick.ToolBarHelper', function (j, b, i) {
      if (e._resultOverlay.getLonLats().length == 4) {
        e._map.showFloatHelper(g.start);
        a = false;
        c = false;
        var k = e._resultOverlay.getLonLats();
        e.endDraw(k);
      } else {
        alert(gisapi.ToolBarHelper_alowTreePoint);
        return;
      }
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      e.activate('SECTOR', g);
      e.bindCallback(e.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == '27') {
        e.activate('SECTOR', g);
        e.bindCallback(e.fn);
      }
    });
  },
  _drawRoundRect: function (g) {
    var f = this;
    var h = DMap.$.extend({}, gisapi.ToolBarHelper_drawRoundRect_tooltip);
    g = DMap.$.extend(h, g);
    var j = null;
    f._map.showFloatHelper(g.start);
    f._drawing = 'ROUNDRECT';
    var a = false;
    var d = false;
    DMap.$(f._map).bind('mousedown.ToolBarHelper', function (c, b) {
      f._map._enableDragPan = false;
      if (!f._resultOverlay) {
        if (!d) {
          a = true;
          c.stopPropagation();
        }
        j = b;
        f._resultOverlay = new DMap.Polygon([b]);
        f._map.addOverlay(f._resultOverlay);
      } else {
        f._map._enableDragPan = true;
      }
      e = true;
    });
    var e = true;
    DMap.$(document).bind('mousemove.ToolBarHelper', function (k) {
      if (f._drawing != 'ROUNDRECT') {
        return;
      }
      if (f._map._enableDragPan) {
        e = false;
      }
      var b = f._map.fromMouseEventToLonLat(k);
      if (a) {
        d = true;
        f._map.showFloatHelper(g.end);
        a = false;
      }
      if (f._resultOverlay) {
        var c = [j, new DMap.LonLat(b.lon, j.lat), b, new DMap.LonLat(j.lon, b.lat), j];
        f._resultOverlay.updateVertex(1, new DMap.LonLat(b.lon, j.lat));
        f._resultOverlay.updateVertex(2, b);
        f._resultOverlay.updateVertex(3, new DMap.LonLat(j.lon, b.lat));
        f._resultOverlay.updateVertex(4, j);
      }
    });
    var i = true;
    DMap.$(document).bind('mouseup.ToolBarHelper', function (b) {
      if (b.which != 1) {
        return;
      }
      if (f._drawing != 'ROUNDRECT') {
        return;
      }
      a = false;
      if (f._resultOverlay && !d && i) {
        f._map.showFloatHelper(g.end);
        i = false;
        return;
      }
      if (f._resultOverlay && e) {
        f._map.showFloatHelper(g.start);
        f.endDraw(f._resultOverlay.getLonLats());
        i = true;
        d = false;
      }
    });
    DMap.$(document).bind('contextmenu.ToolBarHelper', function (b) {
      f.activate('ROUNDRECT', g);
      f.bindCallback(f.fn);
      return false;
    });
    DMap.$(document).bind('keydown.ToolBarHelper', function (b) {
      if (b.keyCode == 'ROUNDRECT') {
        f.activate('ROUNDRECT', g);
        f.bindCallback(f.fn);
      }
    });
  }
});
DMap.Class('LayerControl', DMap.Control, {
  _map: null,
  _opt: null,
  _layerOverlayArray: [],
  containerDiv: null,
  initialize: function (b, a) {
    this._opt = a || '';
    this._layerOverlayArray = b;
  },
  setPosition: function (d, b, c, a) {
    DMap.$(this.containerDiv).css({left: d, right: b, top: c, bottom: a});
  },
  _getImageUrl: function () {
  },
  drawCheckbox: function () {
    var e = this;
    this.bodydiv.innerHTML = '';
    if (this._layerOverlayArray) {
      for (var d = 0; d < this._layerOverlayArray.length; d++) {
        var a = document.createElement('div');
        var c = '';
        c += '<input type="checkbox"' + (this._layerOverlayArray[d][2] ? ' checked="true"' : '') + '/>';
        c += this._layerOverlayArray[d][1];
        a.innerHTML = c;
        var b = a.firstChild;
        this.bodydiv.appendChild(a);
        DMap.$(b).attr('value', this._layerOverlayArray[d][0]).bind('click', this._layerOverlayArray[d], function (h) {
          for (var f = 0; f < e._layerOverlayArray.length; f++) {
            if (e._layerOverlayArray[f][0] == h.data[0]) {
              var g = e._layerOverlayArray[f][0];
              if (e._layerOverlayArray[f][2]) {
                e._map.removeOverlay(g);
                g = null;
                e._layerOverlayArray[f][2] = false;
              } else {
                try {
                  e._map.addOverlay(g);
                  e._layerOverlayArray[f][2] = true;
                } catch (h) {
                  alert(h.message);
                }
              }
            }
          }
          e.refresh();
        });
      }
    }
  },
  setLayerVisible: function (c, a) {
    for (var b = 0; b < this._opt.length; b++) {
      if (this._opt[b].key == c) {
        if (a) {
          this._opt[b].isVisible = true;
        } else {
          this._opt[b].isVisible = false;
        }
      }
    }
    this.drawCheckbox();
    this.refresh();
  },
  draw: function (c) {
    var b = this;
    b._map = c;
    this.containerDiv = document.createElement('div');
    DMap.$(this.containerDiv).css({
      overflow: 'auto',
      position: 'absolute',
      fontSize: '12px',
      border: '1px solid black',
      backgroundColor: 'white',
      right: '190px',
      top: '8px',
      width: '80px'
    });
    var a = document.createElement('div');
    a.innerHTML = gisapi.LayerControl_text;
    DMap.$(a).css({
      textAlign: 'center',
      paddingTop: '2px',
      cursor: 'pointer',
      width: '65px'
    }).bind('click', function () {
      (b.bodydiv.style.display == 'none') ? b.bodydiv.style.display = 'block' : b.bodydiv.style.display = 'none';
    });
    this.containerDiv.appendChild(a);
    this.bodydiv = document.createElement('div');
    DMap.$(this.bodydiv).css({display: 'none', border: '1px outset #111'});
    this.containerDiv.appendChild(this.bodydiv);
    this.drawCheckbox();
    DMap.$(b._map._paneDom).append(this.containerDiv);
  },
  remove: function () {
    DMap.$(this._map).unbind('zoomend.LayerControl');
    if (this.containerDiv) {
      DMap.Util.removeNode(this.containerDiv);
      this.containerDiv = null;
    }
  },
  refresh: function () {
    DMap.$(this._map).unbind('LayerControl');
  }
});
DMap.Class('DialogControl', DMap.Control, {
  _mask: null,
  _dialog: null,
  _map: null,
  _dialogCss: null,
  _dialogHeight: 200,
  _dialogWidth: 300,
  _title: '',
  _titleCss: null,
  _text: '',
  _textCss: null,
  _baseCss: '',
  _hasMask: null,
  ofLeft: 0,
  ofTop: 0,
  me: null,
  titleDiv: null,
  textDiv: null,
  _dragable: null,
  _dragging: null,
  _dragStartX: 0,
  _dragStartY: 0,
  _dragStartLeft: 0,
  _dragStartTop: 0,
  initialize: function (a) {
    var a = a || {};
    this._dialogCss = a.dialogCss || null;
    this._dialogHeight = a.height || 200;
    this._dialogWidth = a.width || 300;
    this._title = a.title || 'Dialog Title';
    this._titleCss = a.titleCss || null;
    this._text = a.text || 'content';
    this._textCss = a.textCss || null;
    this._dialog = document.createElement('div');
    this._dialog.id = DMap.Util.createUniqueID();
    this.titleDiv = document.createElement('div');
    this.textDiv = document.createElement('div');
    this.setDragable(true);
  },
  draw: function (c) {
    var b = this;
    b._map = c;
    var a = b._map.getSize();
    if (a.h < this._dialogHeight) {
      this._dialogHeight = a.h;
    }
    if (a.w < this._dialogWidth) {
      this._dialogWidth = a.w;
    }
    ofLeft = (a.w - parseInt(this._dialogWidth)) / 2;
    ofTop = (a.h - parseInt(this._dialogHeight)) / 2;
    this._dialog.appendChild(this.titleDiv);
    this._dialog.appendChild(this.textDiv);
    b._map.getContainer().appendChild(this._dialog);
    this.showDialog();
  },
  remove: function () {
    if (this._dialog) {
      this._map.getContainer().removeChild(this._dialog);
      this._dialog = null;
    }
    this.setDragable(false);
    return;
  },
  setContent: function (a) {
    this._text = a;
    this.textDiv.innerHTML = this._text;
  },
  setTitle: function (d) {
    var b = this;
    this._title = d;
    DMap.$(this.titleDiv).empty();
    DMap.$(this.titleDiv).append('<div style=\'float:left; height:30px;padding-left:5px; background:url(' + gisapi.getMarkerImageUrl('dialog_t1.gif') + ') no-repeat left\'>' + this._title + '</div>');
    var a = DMap.$('<div style=\'float:right;height:30px;width:20px; background:url(' + gisapi.getMarkerImageUrl('dialog_t3.gif') + ') no-repeat right\'></div>');
    var c = DMap.$('<img src=\'' + gisapi.getMarkerImageUrl('dialog_t4.gif') + '\' style=\'padding:5px;cursor : hand\'/>');
    DMap.$(c).click(function () {
      b.shutDiv();
    });
    a.append(c);
    DMap.$(this.titleDiv).append(a);
  },
  showDiv: function () {
    this._dialog.style.display = '';
  },
  shutDiv: function () {
    this._dialog.style.display = 'none';
  },
  setDialogCss: function (a) {
    this._dialogCss = a;
    DMap.$(this._dialog).css(this._dialogCss);
  },
  setTitleCss: function (a) {
    this._titleCss = a;
    DMap.$(this.titleDiv).css(this._titleCss);
  },
  setTextCss: function (a) {
    this.textDiv = a;
    DMap.$(this.textDiv).css(this._textCss);
  },
  showDialog: function () {
    var b = this;
    if (this._dialogCss == null) {
      DMap.$(this._dialog).css({
        position: 'absolute',
        zIndex: 1000,
        left: ofLeft,
        top: ofTop,
        height: this._dialogHeight,
        width: this._dialogWidth,
        border: '2px outset  #B4C6DB',
        background: '#eee url(' + gisapi.getMarkerImageUrl('dialog_bg.png') + ') 0 0 repeat-x',
        margin: 0,
        padding: 0,
        opacity: 0.95
      });
    } else {
      DMap.$(this._dialog).css(this._dialogCss);
    }
    DMap.$(this.titleDiv).empty();
    if (this._titleCss == null) {
      DMap.$(this.titleDiv).css({
        border: '3px solid  #ddd',
        background: '#B4C6DB url(' + gisapi.getMarkerImageUrl('dialog_t2.gif') + ') 0 0 repeat-x',
        clear: 'both',
        display: 'block',
        width: this._dialogWidth - 3,
        height: '30px'
      });
    } else {
      DMap.$(this.titleDiv).css(this._titleCss);
    }
    DMap.$(this.titleDiv).append('<div style=\'float:left; height:30px;padding-left:5px; background:url(' + gisapi.getMarkerImageUrl('dialog_t1.gif') + ') no-repeat left\'>' + this._title + '</div>');
    var a = DMap.$('<div style=\'float:right;height:30px;width:20px; background:url(' + gisapi.getMarkerImageUrl('dialog_t3.gif') + ') no-repeat right\'></div>');
    var c = DMap.$('<img src=\'' + gisapi.getMarkerImageUrl('dialog_t4.gif') + '\' style=\'padding:5px;cursor : hand\'/>');
    DMap.$(c).click(function () {
      b.shutDiv();
    });
    a.append(c);
    DMap.$(this.titleDiv).append(a);
    if (this._textCss == null) {
      DMap.$(this.textDiv).css({
        clear: 'both',
        display: 'block',
        width: '100%',
        height: (this._dialogHeight - 40) + 'px',
        padding: '5px',
        overflow: 'auto'
      });
    } else {
      DMap.$(this.textDiv).css(this._textCss);
    }
    this.textDiv.innerHTML = this._text;
  },
  setDragable: function (b) {
    this._dragable = b;
    var a = this;
    if (b) {
      DMap.$(this.titleDiv).bind('mousedown', function (c) {
        if (!this._dragging) {
          a._dragStartX = c.clientX;
          a._dragStartY = c.clientY;
          a._dragStartLeft = parseInt(a._dialog.style.left) || 0;
          a._dragStartTop = parseInt(a._dialog.style.top) || 0;
          a._dragging = true;
          DMap.$(document).bind('mousemove.Dialog', function (d) {
            if (a._dragable && a._dragging) {
              a.titleDiv.style.cursor = 'move';
              a._dialog.style.left = a._dragStartLeft + d.clientX - a._dragStartX;
              a._dialog.style.top = a._dragStartTop + d.clientY - a._dragStartY;
            }
            return false;
          });
        }
        DMap.$(document).bind('mouseup.Dialog', function (d) {
          a._dragging = false;
          a.titleDiv.style.cursor = 'auto';
          DMap.$(document).unbind('.Dialog');
          return false;
        });
        return false;
      });
    } else {
      if (this.titleDiv) {
        DMap.$(this.titleDiv).unbind('mousedown');
      }
      DMap.$(document).unbind('.Dialog');
    }
  }
});
DMap.Class('ZoomBarControl', {
  LEVEL_HEIGHT: 11,
  MAGIC_HEIGHT: 17,
  LEVEL_TOP: 75,
  dom: null,
  proportion: 1,
  initialize: function () {
    var f = this;
    this.dom = DMap.$('<div class="map-zoombar" unselectable="on"></div>');
    this.plusDom = DMap.$('<div class="map-zoombar-plus" title=\'' + gisapi.ZoomBarControl_zoominTitle + '\' unselectable="on"></div>');
    this.minusDom = DMap.$('<div class="map-zoombar-minus" title=\'' + gisapi.ZoomBarControl_zoomoutTitle + '\' unselectable="on"></div>');
    this.levelsDom = DMap.$('<div class="map-zoombar-levels" unselectable="on"></div>');
    this.indicatorDom = DMap.$('<div class="map-zoombar-indicator" title=\'' + gisapi.ZoomBarControl_dragTitle + '\' unselectable="on"></div>');
    var h = this.createNavigateImg('north.png', '0px', '20px', gisapi.ZoomBarControl_topTitle);
    var d = this.createNavigateImg('east.png', '20px', '40px', gisapi.ZoomBarControl_rightTitle);
    var c = this.createNavigateImg('south.png', '40px', '20px', gisapi.ZoomBarControl_downTitle);
    var b = this.createNavigateImg('west.png', '20px', '0px', gisapi.ZoomBarControl_leftTitle);
    var a = this.createNavigateImg('center.png', '20px', '20px', gisapi.common_fullmap);
    this.navigate = DMap.$('<div style="position:absolute;top:8px;left:8px;" class="noprint"></div>').append(h).append(d).append(c).append(b).append(a);
    this.navigateContent = DMap.$('<div style="position: absolute; top:70px; LEFT: 19px; width: 35px;"></div>');
    this.navigateContent.append(this.plusDom).append(this.levelsDom).append(this.minusDom).append(this.indicatorDom);
    this.dom.append(this.navigate);
    this.dom.append(this.navigateContent);
    this.isKeyDown = false;
    this.totalTime = 1000;
    h.bind('mousedown', function () {
      f.isKeyDown = true;
      var e = 0;
      (function () {
        var k = f._map.fromLonLatToContainerPixel(f._map.getCenter());
        var i = k.x;
        var l = k.y;
        e += 50;
        var j = f._map.fromContainerPixelToLonLat(new DMap.Pixel(i, l + 5 + (e / f.totalTime) * 5));
        f._map.setCenter(j);
        if (f.isKeyDown) {
          setTimeout(arguments.callee, 50);
        }
      })();
    }).bind('mouseup mouseout', function () {
      f.isKeyDown = false;
    });
    c.bind('mousedown', function () {
      f.isKeyDown = true;
      var e = 0;
      (function () {
        var k = f._map.fromLonLatToContainerPixel(f._map.getCenter());
        var i = k.x;
        var l = k.y;
        e += 50;
        var j = f._map.fromContainerPixelToLonLat(new DMap.Pixel(i, l - 5 - (e / f.totalTime) * 5));
        f._map.setCenter(j);
        if (f.isKeyDown) {
          setTimeout(arguments.callee, 50);
        }
      })();
    }).bind('mouseup mouseout', function () {
      f.isKeyDown = false;
    });
    d.bind('mousedown', function () {
      f.isKeyDown = true;
      var e = 0;
      (function () {
        var k = f._map.fromLonLatToContainerPixel(f._map.getCenter());
        var i = k.x;
        var l = k.y;
        e += 50;
        var j = f._map.fromContainerPixelToLonLat(new DMap.Pixel(i - 5 - (e / f.totalTime) * 5, l));
        f._map.setCenter(j);
        if (f.isKeyDown) {
          setTimeout(arguments.callee, 50);
        }
      })();
    }).bind('mouseup mouseout', function () {
      f.isKeyDown = false;
    });
    b.bind('mousedown', function () {
      f.isKeyDown = true;
      var e = 0;
      (function () {
        var k = f._map.fromLonLatToContainerPixel(f._map.getCenter());
        var i = k.x;
        var l = k.y;
        e += 50;
        var j = f._map.fromContainerPixelToLonLat(new DMap.Pixel(i + 5 + (e / f.totalTime) * 5, l));
        f._map.setCenter(j);
        if (f.isKeyDown) {
          setTimeout(arguments.callee, 50);
        }
      })();
    }).bind('mouseup mouseout', function () {
      f.isKeyDown = false;
    });
    a.bind('click', function () {
      f._map.fullExtent();
    });
    this.navigate.bind('mousedown', function (e) {
      e.preventDefault();
      e.stopPropagation();
    });
    this.levelsDom.bind('mousedown', function (e) {
      e.preventDefault();
      e.stopPropagation();
    });
    this.levelsDom.bind('click', this, function (e) {
      var i = e.data;
      if (e.target !== this) {
        var j = parseInt(e.target.innerHTML);
        i._map.setZoom(j, true);
      }
    });
    this.plusDom.bind('click', this, function (e) {
      var i = e.data;
      i._map.zoomIn();
    }).preventBubbles('mousedown click');
    this.minusDom.bind('click', this, function (e) {
      var i = e.data;
      i._map.zoomOut();
    }).preventBubbles('mousedown click');
    this.indicatorDom.bind('mousedown', this, function (e) {
      e.preventDefault();
      e.stopPropagation();
      var i = e.data;
      i.dragging = true;
    });
    DMap.$(document).bind('mousemove.zoombar', this, function (e) {
      var i = e.data;
      if (!i.dragging) {
        return;
      }
      var l = i.levelsDom.offset();
      var m = e.clientY - l.top;
      var j = 1;
      var k = i.LEVEL_HEIGHT * i._map.getZoomNums() - i.MAGIC_HEIGHT / 2;
      k = k * i.proportion;
      var l = e.clientY;
      m = Math.max(j, m);
      m = Math.min(k, m);
      i.indicatorDom.css('top', m + i.MAGIC_HEIGHT);
    });
    DMap.$(document).bind('mouseup.zoombar', this, function (e) {
      var i = e.data;
      var i = e.data;
      if (!i.dragging) {
        return;
      }
      var k = i.levelsDom.offset();
      var m = e.clientY - k.top;
      var l = Math.floor(m / (i.LEVEL_HEIGHT * i.proportion));
      var j = i._map.getZoomNums() - l - 1;
      j = Math.max(0, j);
      j = Math.min(i._map.getZoomNums(), j);
      i._map.setZoom(j, true);
      i.dragging = false;
    });
    try {
      if (needPngFix) {
        document.execCommand('BackgroundImageCache', false, true);
      }
    } catch (g) {
    }
  },
  draw: function (e) {
    this._map = e;
    var d = this._map.getZoomNums() - 1;
    var a = DCMapServer.GlobeParams.MapMinLevel;
    if (a >= DCMapServer.GlobeParams.ZoomOffset) {
      a = a - DCMapServer.GlobeParams.ZoomOffset;
      d = d - DCMapServer.GlobeParams.ZoomOffset;
    }
    for (var b = d; b >= a; b--) {
      this.levelsDom.append('<div class="map-zoombar-level" title=\'' + gisapi.ZoomBarControl_dragTitle + '\' unselectable="on">' + b + '</div>');
    }
    this.dom.appendTo('#' + this._map._viewportId);
    DMap.$(this._map).bind('zoomend.zoombar', this, function (g, i, f) {
      var h = g.data;
      h.redraw();
    });
    var c = this;
    this.proportion = parseFloat(this.levelsDom.css('height')) / (this.LEVEL_HEIGHT * (this._map.getZoomNums() - DCMapServer.GlobeParams.MapMinLevel));
    this.redraw();
  },
  setPosition: function (d, b, c, a) {
    this.dom.css({left: d, right: b, top: c, bottom: a});
  },
  redraw: function () {
    var a = this._map.getZoomNums();
    var b = this._map.getZoom();
    var d = a - b;
    var c = this.MAGIC_HEIGHT + (2 * d - 1) * this.LEVEL_HEIGHT / 2;
    c = c * this.proportion;
    if (!DMap.$.browser.msie) {
      c = c - 2;
    }
    if (c < this.MAGIC_HEIGHT) {
      return;
    }
    this.indicatorDom.css('top', c + 'px');
  },
  hide: function () {
    DMap.$(this.dom).css('visibility', 'hidden');
  },
  show: function () {
    DMap.$(this.dom).css('visibility', 'visible');
  },
  remove: function () {
    this.dom.remove();
    this.levelsDom.unbind();
    this.indicatorDom.unbind();
    this.plusDom.unbind();
    this.minusDom.unbind();
    DMap.$(this._map).unbind('.zoombar');
    DMap.$(document).unbind('.zoombar');
    this.dom = null;
    this.levelsDom = null;
    this.indicatorDom = null;
    this.plusDom = null;
    this.minusDom = null;
    this._map = null;
  },
  createNavigateImg: function (a, c, b, d) {
    return DMap.$('<div style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + gisapi.getImageUrl('navigate/' + a) + '\',sizingMethod=crop); TOP: ' + c + ';LEFT:' + b + '" class="map-zoombar-navigate" title=' + d + '  unselectable="on" lP="false"><img src=\'' + gisapi.getImageUrl('navigate/' + a) + '\'></div>');
  }
});
DMap.Class('ZoomBarControlGoogle', DMap.Control, {
  container: null,
  move_div: null,
  move_image: null,
  move_top: null,
  move_left: null,
  move_right: null,
  move_down: null,
  move_result: null,
  initialize: function () {
    this.container = document.createElement('DIV');
    this.move_div = document.createElement('DIV');
    this.move_div.id = 'moveid';
    this.move_div.style.overflow = 'hidden';
    this.move_div.style.position = 'absolute';
    this.move_div.style.left = '0px';
    this.move_div.style.top = '0px';
    this.move_div.style.width = '59px';
    this.move_div.style.height = '62px';
    this.move_image = document.createElement('img');
    DMap.$(this.move_image).css({
      position: 'absolute',
      top: '0px',
      left: '0px',
      border: '0px none',
      margin: '0px',
      padding: '0px',
      width: '59px',
      height: '492'
    }).attr('src', gisapi.getMarkerImageUrl('ZoomBar.png'));
    this.move_top = document.createElement('div');
    this.move_top.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.move_top).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '20px',
      top: '0px',
      width: '18px',
      height: '18px',
      cursor: 'pointer'
    }).attr({title: gisapi.ZoomBarControl_topTitle});
    this.move_left = document.createElement('div');
    this.move_left.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.move_left).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '0px',
      top: '20px',
      width: '18px',
      height: '18px',
      cursor: 'pointer'
    }).attr({title: gisapi.ZoomBarControl_leftTitle});
    this.move_right = document.createElement('div');
    this.move_right.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.move_right).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '40px',
      top: '20px',
      width: '18px',
      height: '18px',
      cursor: 'pointer'
    }).attr({title: gisapi.ZoomBarControl_rightTitle});
    this.move_down = document.createElement('div');
    this.move_down.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.move_down).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '20px',
      top: '40px',
      width: '18px',
      height: '18px',
      cursor: 'pointer'
    }).attr({title: gisapi.ZoomBarControl_downTitle});
    this.move_result = document.createElement('div');
    this.move_result.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.move_result).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '20px',
      top: '20px',
      width: '18px',
      height: '18px',
      cursor: 'pointer'
    }).attr({title: gisapi.common_fullmap});
    this.move_div.appendChild(this.move_image);
    this.move_div.appendChild(this.move_top);
    this.move_div.appendChild(this.move_left);
    this.move_div.appendChild(this.move_right);
    this.move_div.appendChild(this.move_down);
    this.move_div.appendChild(this.move_result);
    this.container.appendChild(this.move_div);
    this.zoominDiv = document.createElement('DIV');
    DMap.$(this.zoominDiv).attr('unselectable', 'on').css({
      overflow: 'hidden',
      position: 'absolute',
      left: '0px',
      top: '62px',
      width: '59px',
      height: '164px'
    });
    var a = document.createElement('img');
    DMap.$(a).css({
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      left: '0px',
      top: '-62px',
      width: '59px',
      height: '492px'
    }).attr('src', gisapi.getMarkerImageUrl('ZoomBar.gif'));
    this.zoomin_button = document.createElement('DIV');
    this.zoomin_button.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.zoomin_button).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '20px',
      top: '0px',
      width: '20px',
      height: '27px',
      cursor: 'pointer',
      'background-color': 'white',
      opacity: '0'
    }).attr({title: gisapi.ZoomBarControl_zoominTitle});
    this.zoominDiv.appendChild(a);
    this.zoominDiv.appendChild(this.zoomin_button);
    this.container.appendChild(this.zoominDiv);
    this.zoomoutDiv = document.createElement('DIV');
    DMap.$(this.zoomoutDiv).attr('unselectable', 'on').css({
      overflow: 'hidden',
      position: 'absolute',
      left: '0px',
      width: '59px',
      height: '354px'
    });
    var c = document.createElement('img');
    DMap.$(c).css({
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      left: '0px',
      top: '-354px',
      width: '59px',
      height: '492px'
    }).attr('src', gisapi.getMarkerImageUrl('ZoomBar.gif'));
    this.zoomout_button = document.createElement('DIV');
    this.zoomout_button.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.zoomout_button).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '20px',
      top: '0px',
      width: '20px',
      height: '27px',
      cursor: 'pointer',
      'background-color': 'white',
      opacity: '0'
    }).attr({title: gisapi.ZoomBarControl_zoomoutTitle});
    this.zoomoutDiv.appendChild(c);
    this.zoomoutDiv.appendChild(this.zoomout_button);
    this.container.appendChild(this.zoomoutDiv);
    this.dragDiv = document.createElement('DIV');
    this.dragDiv.innerHTML = '&nbsp;&nbsp;&nbsp;';
    DMap.$(this.dragDiv).attr('unselectable', 'on').css({position: 'absolute', left: '19px', cursor: 'pointer'});
    var b = document.createElement('img');
    DMap.$(b).css({
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      left: '0px',
      top: '-384px',
      width: '59px',
      height: '492px'
    }).attr('src', gisapi.getMarkerImageUrl('ZoomBar.gif'));
    this.drag_button = document.createElement('DIV');
    DMap.$(this.drag_button).css({
      overflow: 'hidden',
      width: '22px',
      height: '14px',
      position: 'absolute',
      left: '0px',
      cursor: 'url(' + gisapi.getMarkerImageUrl('openhand.cur') + '), default'
    }).attr({title: gisapi.ZoomBarControl_dragTitle});
    this.drag_button.appendChild(b);
    this.dragDiv.appendChild(this.drag_button);
    this.container.appendChild(this.dragDiv);
  },
  setPosition: function (d, b, c, a) {
    DMap.$(this.container).css({left: d, right: b, top: c, bottom: a});
  },
  draw: function (b) {
    var i = this;
    i._map = b;
    DMap.$(i._map).bind('leftPanelControlShow.ZoomBarControl', function (m, l) {
      i.setPosition(l, null, '20px', null);
    });
    DMap.$(i._map).bind('leftPanelControlHide.ZoomBarControl', function (m, l) {
      i.setPosition(l, null, '20px', null);
    });
    var k = i._map.getSize();
    var g = i._map.getZoomNums();
    var h = 6;
    var j = 59;
    var e = 62;
    var f = 27;
    var a = (DCMapServer.GlobeParams.MapMaxLevel - DCMapServer.GlobeParams.MapMinLevel - 1) * h;
    var d = 27;
    DMap.$(this.container).css({
      overflow: 'hidden',
      position: 'absolute',
      height: e + f + d + a + 7,
      width: '59px'
    }).attr('unselectable', 'on');

    function c(m) {
      if (m == 'move') {
        var l = i._map.getCenter();
        i._map.panTo(l);
      } else {
        if (m == 'zoom') {
          var l = i._map.getZoom();
          i._map.setZoom(l);
        }
      }
    }

    DMap.$(this.move_top).bind('click', function () {
      c('move');
      i._map.panDirection(0, -k.h / 4);
    });
    DMap.$(this.move_left).bind('click', function () {
      c('move');
      i._map.panDirection(-k.w / 4, 0);
    });
    DMap.$(this.move_right).bind('click', function () {
      c('move');
      i._map.panDirection(k.w / 4, 0);
    });
    DMap.$(this.move_down).bind('click', function () {
      c('move');
      i._map.panDirection(0, k.h / 4);
    });
    DMap.$(this.move_result).bind('click', function () {
      i._map.fullExtent();
    });
    DMap.$(this.zoomoutDiv).css('top', (e + f + a + 7) + 'px');
    DMap.$(this.zoomout_button).bind('click', function () {
      c('zoom');
      i._map.zoomOut();
    });
    DMap.$(this.zoomin_button).bind('click', function () {
      c('zoom');
      i._map.zoomIn();
    });
    DMap.$(this.drag_button).css('top', a - (i._map.getZoom()) * h);
    DMap.$(this.dragDiv).css({top: e + e + f, height: a}).bind('mousedown', function (m) {
      var n = m.pageY - parseInt(this.style.top) - 7 - i._map.getContainerPosition().top;
      DMap.$(i.drag_button).css({top: n});
      var l = (a - n) / h;
      c('zoom');
      i._map.setZoom(parseInt(l));
    });
    DMap.$(i._map).bind('zoomend', function (n, m, l) {
      DMap.$(i.drag_button).css({top: a - (l) * h});
    });
    this._dragObject = new DMap.DraggableObject(this.drag_button);
    DMap.$.extend(this._dragObject, {
      dragstart: function () {
      }, drag: function (m, l) {
        if (l > 0 && l < a) {
          this.moveTo(0, l);
        }
      }, dragend: function (m) {
        var n = parseInt(i.drag_button.style.top);
        DMap.$(i.drag_button).css({top: n});
        var l = (a - n) / h;
        c('zoom');
        i._map.setZoom(Math.round(l));
      }
    });
    DMap.$(this.container).appendTo('#' + i._map._viewportId);
  },
  hide: function () {
    DMap.$(this.container).css('visibility', 'hidden');
  },
  show: function () {
    DMap.$(this.container).css('visibility', 'visible');
  },
  remove: function () {
    if (this._dragObject) {
      this._dragObject.destory();
      this._dragObject = null;
    }
    DMap.$(this._map).unbind('.ZoomBarControl');
    DMap.Util.removeNode(this.container);
    this.container = null;
  }
});
DMap.Class('OverviewMapControl', DMap.Control, {
  containerDiv: null,
  state: 0,
  mark: null,
  width: 250,
  height: 150,
  minWidth: 21,
  minHeight: 21,
  proportion: 1,
  initialize: function () {
    this.containerDiv = document.createElement('div');
  },
  setPosition: function (d, b, c, a) {
    DMap.$(this.containerDiv).css({left: d, right: b, top: c, bottom: a});
  },
  draw: function (a) {
    var k = this;
    k._map = a;
    var n = k._map.getSize();
    if (!DMap.$.browser.msie) {
      k.minWidth = 13;
      k.minHeight = 13;
    }
    DMap.$(this.containerDiv).css({
      overflow: 'hidden',
      position: 'absolute',
      right: '0px',
      bottom: '0px',
      width: k.minWidth + 'px',
      height: k.minHeight + 'px'
    });
    DMap.$(this.containerDiv).addClass('map-overview').preventBubbles('mousedown click');
    var m = document.createElement('div');
    m.id = DMap.Util.createUniqueID();
    DMap.$(m).css({
      position: 'absolute',
      right: '0px',
      bottom: '0px',
      width: '100%',
      height: '100%',
      border: '1px none'
    });
    var j = document.createElement('div');
    this.controlBtn = j;
    DMap.$(j).css({
      overflow: 'hidden',
      position: 'absolute',
      cursor: 'pointer',
      right: '0px',
      bottom: '0px',
      width: 13,
      height: 13,
      background: '#fff url(' + gisapi.getMarkerImageUrl('open.gif') + ') 0 0 repeat-x'
    });
    DMap.$(j).click(function (r, q) {
      if (q == 'close') {
        if (parseInt(k.containerDiv.style.width) != k.minWidth) {
          o();
        }
      } else {
        if (q == 'open') {
          if (parseInt(k.containerDiv.style.width) == k.minWidth) {
            p();
          }
        } else {
          if (parseInt(k.containerDiv.style.width) != k.minWidth) {
            o();
          } else {
            p();
          }
        }
      }

      function p() {
        l();
        DMap.$(k._map).trigger('*.OverviewMapControl');
        e.moveToLonlat(k._map.getCenter());
        DMap.$(k.containerDiv).animate({width: k.width + 'px', height: k.height + 'px'}, {
          complete: function () {
            g();
          }
        });
        DMap.$(j).css({background: '#fff url(' + gisapi.getMarkerImageUrl('close.gif') + ') 0 0 repeat-x'});
        k.state = 1;
      }

      function o() {
        i();
        DMap.$(k.containerDiv).animate({width: k.minWidth + 'px', height: k.minHeight + 'px'});
        DMap.$(j).css({background: '#fff url(' + gisapi.getMarkerImageUrl('open.gif') + ') 0 0 repeat-x'});
        k.state = 0;
      }
    });
    this.containerDiv.appendChild(m);
    this.containerDiv.appendChild(j);
    k._map.getContainer().appendChild(this.containerDiv);
    var h = null;
    var f = function () {
      var p = DMap.$.map(k._map._mapTypeArray, function (q) {
        return q.copy();
      });
      var o = DMap.$.map(k._map.resolutions, function (q) {
        return q;
      });
      h = new DMap.Map(m, {mapTypes: c(p), resolutions: o, isScrollWheelZoom: false});
      g();
    };
    var c = function (s) {
      var o = [];
      for (var q = 0; q < s.length; q++) {
        var r = [];
        var p = [];
        p.push(s[q].tileUrlTemplate);
        r.push(s[q]._typeName);
        r.push(p);
        o.push(r);
      }
      return o;
    };
    var g = function () {
      var o = k._map.getZoom();
      if (o <= 3) {
        o = 0;
      } else {
        o -= 3;
      }
      h.setCenter(k._map.getCenter(), o);
    };
    f();
    var e = new DMap.MoveMarker(h.getCenter(), {
      type: 1,
      size: new DMap.Size(k.width / 1.5, k.height / 2),
      offsetType: 'mm',
      borderWidth: 1,
      borderColor: 'blue',
      color: 'blue',
      opacity: 0.2
    });
    e.setDragEvent();
    e._setForOverview(true);
    h.addOverlay(e);
    DMap.$(e).bind('dragend', function (p) {
      var q = k._map.fromLonLatToDivPixel(this.getLonlat());
      var o = k._map.fromLonLatToDivPixel(k._map.getCenter());
      k._map.panDirection(o.x - q.x, o.y - q.y, false, 500);
      var q = h.fromLonLatToDivPixel(this.getLonlat());
      var o = h.fromLonLatToDivPixel(k._map.getCenter());
      h.panDirection(o.x - q.x, o.y - q.y, false, 500);
    });
    var l = function () {
      DMap.$(k._map).bind('moveend.OverviewMapControl', function (o) {
        if (!this.getCenter().equals(h.getCenter())) {
          h.setCenter(this.getCenter());
          e.moveToLonlat(this.getCenter());
        }
      });
      DMap.$(k._map).bind('zoomend.OverviewMapControl', function (q, o, p) {
        if (p <= 3) {
          p = 0;
        } else {
          p -= 3;
        }
        h.setCenter(this.getCenter(), p);
        e.moveToLonlat(this.getCenter());
      });
    };
    this.mark = e;
    var i = function () {
      DMap.$(k._map).unbind('.OverviewMapControl');
    };
    var d = function () {
      DMap.$(h).bind('moveend.OverviewMapControl', function (p) {
        if (!this.getCenter().equals(k._map.getCenter())) {
          var q = k._map.fromLonLatToDivPixel(this.getCenter());
          var o = k._map.fromLonLatToDivPixel(k._map.getCenter());
          k._map.panDirection(o.x - q.x, o.y - q.y, false, 500);
          e.startMove([k._map.getCenter(), this.getCenter()], 500);
        }
      });
    };
    var b = function () {
      DMap.$(h).unbind('.OverviewMapControl');
    };
    DMap.$(h).bind('dragstart', function () {
      i();
      d();
    }).bind('dragend', function () {
      b();
      l();
    });
    DMap.$(k._map).bind('maptypechanged', function () {
      var p = h.getMapTypeArray();
      var o = k._map.getCurrentMapType();
      for (var q = 0; q < p.length; q++) {
        if (o.getName() == p[q].getName()) {
          h.setMapType(p[q]);
        }
      }
    });
  },
  hide: function () {
    DMap.$(this.containerDiv).css('visibility', 'hidden');
  },
  show: function () {
    DMap.$(this.containerDiv).css('visibility', 'visible');
  },
  open: function () {
    DMap.$(this.containerDiv).css('visibility', 'visible');
    DMap.$(this.controlBtn).trigger('click', ['open']);
  },
  close: function () {
    DMap.$(this.controlBtn).trigger('click', ['close']);
  },
  getState: function () {
    return this.state;
  },
  remove: function () {
    DMap.$(this._map).unbind('.OverviewMapControl');
    DMap.Util.removeNode(this.containerDiv);
    this.containerDiv = null;
    this._map = null;
  }
});
DMap.Class('ZoomChangeControl', DMap.Control, {
  _map: null, _containerDiv: null, initialize: function () {
    this._R = 50;
    this._r = 10;
  }, changeAnimate: function (a, e) {
    if (!this._containerDiv) {
      return;
    }
    var d = this;
    var b = d._R;
    var c = d._r;
    this._containerDiv.style.left = (parseInt(a.x) - b) + 'px';
    this._containerDiv.style.top = (parseInt(a.y) - b) + 'px';
    this._containerDiv.style.display = 'block';
    var f = 700;
    if (e == 'in') {
      d.lt.style.left = b - c + 'px';
      d.lt.style.top = b - c + 'px';
      d.lt.style.borderTop = '2px solid #f00';
      d.lt.style.borderRight = '0px';
      d.lt.style.borderBottom = '0px';
      d.lt.style.borderLeft = '2px solid #f00';
      DMap.$(d.lt).stop().animate({left: '0px', top: '0px'}, {
        duration: f, complete: function () {
          d.lt.style.borderWidth = '0px';
        }, queue: false
      });
      d.rt.style.left = b + 'px';
      d.rt.style.top = b - c + 'px';
      d.rt.style.borderTop = '2px solid #f00';
      d.rt.style.borderRight = '2px solid #f00';
      d.rt.style.borderBottom = '0px solid #f00';
      d.rt.style.borderLeft = '0px solid #f00';
      DMap.$(d.rt).stop().animate({left: 2 * b - c + 'px', top: '0px'}, {
        duration: f, complete: function () {
          d.rt.style.borderWidth = '0px';
        }, queue: false
      });
      d.lb.style.left = b - c + 'px';
      d.lb.style.top = b + 'px';
      d.lb.style.borderTop = '0px solid #f00';
      d.lb.style.borderRight = '0px solid #f00';
      d.lb.style.borderBottom = '2px solid #f00';
      d.lb.style.borderLeft = '2px solid #f00';
      DMap.$(d.lb).stop().animate({left: '0px', top: 2 * b - c + 'px'}, {
        duration: f, complete: function () {
          d.lb.style.borderWidth = '0px';
        }, queue: false
      });
      d.rb.style.left = b + 'px';
      d.rb.style.top = b + 'px';
      d.rb.style.borderTop = '0px solid #f00';
      d.rb.style.borderRight = '2px solid #f00';
      d.rb.style.borderBottom = '2px solid #f00';
      d.rb.style.borderLeft = '0px solid #f00';
      DMap.$(d.rb).stop().animate({left: 2 * b - c + 'px', top: 2 * b - c + 'px'}, {
        duration: f, complete: function () {
          d.rb.style.borderWidth = '0px';
          d._containerDiv.style.display = 'none';
        }, queue: false
      });
    }
    if (e == 'out') {
      d.lt.style.left = '0px';
      d.lt.style.top = '0px';
      d.lt.style.borderTop = '0px solid #f00';
      d.lt.style.borderRight = '2px solid #f00';
      d.lt.style.borderBottom = '2px solid #f00';
      d.lt.style.borderLeft = '0px solid #f00';
      DMap.$(d.lt).stop().animate({left: b - c + 'px', top: b - c + 'px'}, {
        duration: f, complete: function () {
          d.lt.style.borderWidth = '0px';
        }, queue: false
      });
      d.rt.style.left = 2 * b - c + 'px';
      d.rt.style.top = '0px';
      d.rt.style.borderTop = '0px solid #f00';
      d.rt.style.borderRight = '0px solid #f00';
      d.rt.style.borderBottom = '2px solid #f00';
      d.rt.style.borderLeft = '2px solid #f00';
      DMap.$(d.rt).stop().animate({left: b + 'px', top: b - c + 'px'}, {
        duration: f, complete: function () {
          d.rt.style.borderWidth = '0px';
        }, queue: false
      });
      d.lb.style.left = '0px';
      d.lb.style.top = 2 * b - c + 'px';
      d.lb.style.borderTop = '2px solid #f00';
      d.lb.style.borderRight = '2px solid #f00';
      d.lb.style.borderBottom = '0px solid #f00';
      d.lb.style.borderLeft = '0px solid #f00';
      DMap.$(d.lb).stop().animate({left: b - c + 'px', top: b + 'px'}, {
        duration: f, complete: function () {
          d.lb.style.borderWidth = '0px';
        }, queue: false
      });
      d.rb.style.left = 2 * b - c + 'px';
      d.rb.style.top = 2 * b - c + 'px';
      d.rb.style.borderTop = '2px solid #f00';
      d.rb.style.borderRight = '0px solid #f00';
      d.rb.style.borderBottom = '0px solid #f00';
      d.rb.style.borderLeft = '2px solid #f00';
      DMap.$(d.rb).stop().animate({left: b + 'px', top: b + 'px'}, {
        duration: f, complete: function () {
          d.rb.style.borderWidth = '0px';
          d._containerDiv.style.display = 'none';
        }, queue: false
      });
    }
  }, draw: function (d) {
    var c = this;
    var a = c._R;
    var b = c._r;
    c._map = d;
    this._containerDiv = document.createElement('div');
    DMap.$(this._containerDiv).attr('unselectable', 'on');
    DMap.$('#' + c._map._viewportId).append(this._containerDiv);
    DMap.$(this._containerDiv).css({
      fontSize: '1%',
      lineHeight: '1%',
      position: 'absolute',
      border: '0px',
      width: 2 * a + 'px',
      height: 2 * a + 'px',
      display: 'none'
    });
    c.lt = document.createElement('div');
    c.rt = document.createElement('div');
    c.lb = document.createElement('div');
    c.rb = document.createElement('div');
    DMap.$.each([c.lt, c.rt, c.lb, c.rb], function (e, f) {
      f.style.position = 'absolute';
      f.style.border = '0px solid #f00';
      f.style.width = b + 'px';
      f.style.height = b + 'px';
    });
    DMap.$(this._containerDiv).append(c.lt);
    DMap.$(this._containerDiv).append(c.rt);
    DMap.$(this._containerDiv).append(c.lb);
    DMap.$(this._containerDiv).append(c.rb);
  }, remove: function () {
    DMap.Util.removeNode(this._containerDiv);
    this._containerDiv = null;
    DMap.$(this.lt).remove();
    this.lt = null;
    DMap.$(this.rb).remove();
    this.rb = null;
    DMap.$(this.rt).remove();
    this.rt = null;
    DMap.$(this.lb).remove();
    this.lb = null;
    this._map = null;
  }
});
DMap.Class('LeftPanelControl', DMap.Control, {
  _paneldom: null,
  _map: null,
  _visible: false,
  initialize: function (b, a) {
    this.width = b || 257;
    this.toggleWidth = a || 5;
  },
  setWidth: function (a) {
    this.width = a || 257;
  },
  draw: function (b) {
    _map = b;
    var a = this;
    a._map = b;
    this._paneldom = document.createElement('div');
    a._map._setLeftPanelWidth(this.width);
    var c = DMap.$(['<table class="map-lpanel-frame" cellpadding="0" cellspacing="0">', '<tr>', '<td class="map-lpanel-content"></td>', '<td><div class="map-lpanel-togglebar"></div></td>', '</tr>', '</table>'].join('')).appendTo(a._map._getLeftPanelDom());
    var a = this;
    c.find('.map-lpanel-togglebar').bind('click', function () {
      a.toggle();
    });
    this._jO = c;
    this.show();
    this.hide();
  },
  toggle: function () {
    this._visible ? this.hide() : this.show();
  },
  show: function () {
    if (!this._visible) {
      this._map._setLeftPanelWidth(this.width);
      this._jO.find('.map-lpanel-content').append('&nbsp;');
      this._jO.find('.map-lpanel-content').show();
      this._jO.find('.map-lpanel-togglebar').removeClass('map-lpanel-togglebar-collapsed');
      this._jO.find('.map-lpanel-togglebar').addClass('map-lpanel-togglebar-expanded');
      this._visible = true;
    }
  },
  hide: function () {
    if (this._visible) {
      this._map._setLeftPanelWidth(this.toggleWidth);
      this._jO.find('.map-lpanel-content').hide();
      this._jO.find('.map-lpanel-togglebar').removeClass('map-lpanel-togglebar-expanded');
      this._jO.find('.map-lpanel-togglebar').addClass('map-lpanel-togglebar-collapsed');
      this._visible = false;
    }
  },
  loadUrl: function (b, a) {
    this.clearContent();
    var c = document.createElement('iframe');
    if (a) {
      c.name = a;
    }
    c.src = b;
    c.width = '100%';
    c.height = '100%';
    c.frameBorder = 'no';
    this._jO.find('.map-lpanel-content').append(c);
  },
  clearContent: function () {
    var c = this._jO.find('.map-lpanel-content>iframe:last').get(0);
    if (c) {
      var f = c.contentWindow || c.window;
      try {
        var a = DCMapServer.GlobeParams.TopWindow.app.modules;
        for (var g in a) {
          var b = a[g];
          if (b.iframeWin === f) {
            DMap.$(b).trigger('unload');
            delete DCMapServer.GlobeParams.TopWindow.app.modules[g];
            break;
          }
        }
        f.DMap.$(f).trigger('unload');
      } catch (d) {
      }
      c.src = 'javascript:false';
    }
    this._jO.find('.map-lpanel-content').find('*').remove();
  },
  getWidth: function () {
    return this.width;
  },
  remove: function () {
    this.clearContent();
    this._jO.remove();
    this._jO = null;
    this._map = null;
  }
});
DMap.Class('MoreLeftPanelControl', DMap.Control, {
  _paneldom: null,
  _map: null,
  _opt: null,
  initialize: function (b, c, a) {
    this._opt = b || [{}];
    this.width = c || 200;
    this.toggleWidth = a || 5;
  },
  draw: function (a) {
    var d = a;
    var g = this;
    g._map = a;
    this._paneldom = document.createElement('div');
    g._map.getContainer().appendChild(this._paneldom);
    DMap.$(this._paneldom).css({
      position: 'absolute',
      'background-color': 'white',
      left: (this.toggleWidth - this.width) + 'px',
      top: '0px',
      opacity: 1,
      height: '100%',
      width: this.width + 'px'
    });
    this._contentDom = document.createElement('div');
    DMap.$(this._contentDom).css({
      position: 'absolute',
      left: '0px',
      top: '0px',
      height: '100%',
      width: (this.width - this.toggleWidth) + 'px'
    });
    this._paneldom.appendChild(this._contentDom);
    this._toggleDom = document.createElement('div');
    DMap.$(this._toggleDom).css({
      position: 'absolute',
      right: '0px',
      top: '0px',
      height: '100%',
      width: this.toggleWidth + 'px',
      cursor: 'pointer',
      'background-color': 'blue'
    }).click(function () {
      g.toggle();
    });
    this._paneldom.appendChild(this._toggleDom);
    this.show();
    this.hide();
    var c = DMap.$('<div/>');
    c.css({position: 'absolute', left: '0px', top: '0px', height: '100%', width: '20px', background: '#eee'});
    DMap.$(this._contentDom).append(c);
    var j = DMap.$('<div/>');
    j.css({
      position: 'absolute',
      left: '20px',
      top: '0px',
      height: '100%',
      width: (this.width - this.toggleWidth - 20) + 'px'
    });
    this._contentDom.appendChild(j.get(0));
    var h = DMap.Util.createUniqueID();
    for (var e = 0; e < this._opt.length; e++) {
      var f = DMap.$('<div/>');
      c.append(f);
      f.attr('id', h + 'MoreLeftPanelControl_hander_' + e).attr('title', this._opt[e].title).html(this._opt[e].title);
      f.css({
        'float': 'left',
        clear: 'both',
        height: '70px',
        width: '100%',
        cursor: 'pointer',
        border: '1px solid #B4C6DB'
      }).click(function () {
        var i = this.id.replace(/hander/g, 'body');
        DMap.$('#' + i).parent().children().hide();
        DMap.$('#' + i).show();
        DMap.$('#' + this.id).parent().children().css({border: '1px solid #B4C6DB', background: '#eee'});
        DMap.$('#' + this.id).css({borderRight: '0px', background: '#fff'});
      });
      var b = DMap.$('<div/>');
      j.append(b);
      b.attr('id', h + 'MoreLeftPanelControl_body_' + e);
      if (this._opt[e].isDefault) {
      } else {
        b.css({display: 'none'});
      }
      this.loadUrl(b.get(0), this._opt[e].url, this._opt[e].name);
    }
  },
  toggle: function () {
    (this._paneldom.style.left == '0px') ? this.hide() : this.show();
  },
  show: function () {
    this._paneldom.style.left = '0px';
    this._contentDom.style.display = 'block';
    DMap.$(this._map).trigger('leftPanelControlShow', [this.width, this.width]);
  },
  hide: function () {
    this._paneldom.style.left = (this.toggleWidth - this.width) + 'px';
    this._contentDom.style.display = 'none';
    DMap.$(this._map).trigger('leftPanelControlHide', [this.toggleWidth, this.width]);
  },
  loadUrl: function (d, b, a) {
    var c = document.createElement('iframe');
    c.src = b;
    if (a) {
      c.name = a;
    }
    c.width = '100%';
    c.height = '100%';
    c.frameBorder = 'no';
    d.appendChild(c);
  },
  clearContent: function () {
    DMap.$('*', this._contentDom).remove();
  },
  getWidth: function () {
    return this.width;
  },
  remove: function () {
    this.clearContent();
    DMap.Util.removeNode(this._paneldom);
    this._paneldom = null;
    this._map = null;
  }
});
DMap.Class('ToolBarControl', DMap.Control, {
  _map: null,
  _dom: null,
  _bar: null,
  temparray: null,
  initialize: function (c) {
    temparray = [];
    this.allTools = {};
    var a = document.createElement('div');
    this._dom = DMap.$(a).addClass('toolbar-anchor');
    var e = document.createElement('div');
    this._bar = DMap.$(e).addClass('toolbar').css({
      opacity: 0.75,
      position: 'relative',
      left: 0,
      top: 0
    }).appendTo(this._dom);
    var i = false;
    var d = 0;
    var b = 0;
    var j = 0;
    var h = 0;
    var g = this;
    var f = document.createElement('div');
    this._dragHandle = DMap.$(f).addClass('toolbar-draghandle').appendTo(this._bar).bind('mousedown', function (k) {
      i = true;
      d = k.clientX;
      b = k.clientY;
      j = parseInt(g._bar.get(0).style.left) || 0;
      oTop = parseInt(g._bar.get(0).style.top) || 0;
      k.preventDefault();
      return false;
    });
    this.rm = new Date().getTime();
    DMap.$(document).bind('mousemove._toolbar' + this.rm, function (k) {
      if (i) {
        g._bar.get(0).style.left = j + k.clientX - d;
        g._bar.get(0).style.top = oTop + k.clientY - b;
        k.preventDefault();
        return false;
      }
    });
    DMap.$(document).bind('mouseup._toolbar' + this.rm, function () {
      i = false;
    });
    this._hash = {};
    if (!c) {
      c = {};
      this.addDefaultTools();
    }
  },
  addDefaultTools: function () {
    var a = this;
    this.addTool({
      name: gisapi.common_move, id: 'tool-pan', pushGroup: 'tool', pushed: true, onActive: function () {
        a._map.deactivate();
      }
    });
    this.addTool({
      name: gisapi.ZoomBarControl_zoominTitle, id: 'tool-zoomin', pushGroup: 'tool', onActive: function () {
        a._map.activateRecZoomIn();
      }
    });
    this.addTool({
      name: gisapi.ZoomBarControl_zoomoutTitle,
      id: 'tool-zoomout',
      pushGroup: 'tool',
      onActive: function () {
        a._map.activateRecZoomOut();
      }
    });
    this.addTool({
      name: gisapi.common_fullmap, id: 'tool-extent', onPress: function () {
        a._map.fullExtent();
      }
    });
    this.addTool({
      name: gisapi.common_print, id: 'tool-print', pushGroup: 'tool', onActive: function () {
        a._map.print();
      }
    });
    this.addTool({
      name: gisapi.common_distance, id: 'tool-measure-len', pushGroup: 'tool', onActive: function () {
        a._map.activateMeaturePolyline();
      }
    });
    this.addTool({
      name: gisapi.common_area, id: 'tool-measure-area', pushGroup: 'tool', onActive: function () {
        a._map.activateMeaturePolygon();
      }
    });
  },
  addQueryTools: function () {
    var a = this;
    this.addTool({
      name: gisapi.point_query, id: 'point-search', pushGroup: 'tool', onActive: function () {
        queryWindow.pointSearch();
      }
    });
    this.addTool({
      name: gisapi.polyline_query, id: 'line-search', pushGroup: 'tool', onActive: function () {
        queryWindow.lineSearch();
      }
    });
    this.addTool({
      name: gisapi.round_query, id: 'round-search', pushGroup: 'tool', onActive: function () {
        queryWindow.roundSearch();
      }
    });
    this.addTool({
      name: gisapi.rectangle_query, id: 'rec-search', pushGroup: 'tool', onActive: function () {
        queryWindow.recSearch();
      }
    });
    this.addTool({
      name: gisapi.polygon_query, id: 'polygon-search', pushGroup: 'tool', onActive: function () {
        queryWindow.polygonSearch();
      }
    });
    this.addTool({
      name: gisapi.large_print, id: 'tool-map-print', onPress: function () {
        var c = 'print/print.html?center_lon={center_lon}&center_lat={center_lat}&zoom={zoom}&mapid={mapid}';
        var e = {};
        var b = a._map.getCenter();
        e.center_lon = b.lon;
        e.center_lat = b.lat;
        e.zoom = a._map.getZoom();
        var d = a._map;
        var f = new Date().getTime();
        window[f] = d;
        e.mapid = f;
        c = c.replace(/{([\w_]+)}/g, function (g, h) {
          return e[h];
        });
        window.open(c);
      }
    });
    this.addTool({
      self: this, name: gisapi.clear, id: 'tool-clear', onPress: function () {
        a._map.clear();
        for (var b = 0; b < self.temparray.length; b++) {
          map.removeOverlay(self.temparray[b]);
          self.temparray[b] = null;
        }
        self.temparray = [];
      }
    });
  },
  setWidth: function () {
  },
  setPosition: function (d, b, c, a) {
    this._dom.css({left: d, right: b, top: c != null ? c : a, bottom: c != null ? '' : a});
  },
  addTool: function (c) {
    var f = document.createElement('div');
    var b = DMap.$(f).addClass('tool').attr('unselectable', 'on');
    b.get(0).onmouseover = function () {
      DMap.$(this).addClass('hover');
    };
    b.get(0).onmouseout = function () {
      DMap.$(this).removeClass('hover');
      if (!this.__pushGroup) {
        DMap.$(this).removeClass('active');
      }
    };
    b.get(0).onmouseup = function () {
      if (!this.__pushGroup) {
        DMap.$(this).removeClass('active');
        this.onpress();
      }
    };
    b.get(0).onmousedown = function (g) {
      if (!this.__pushGroup) {
        DMap.$(this).addClass('active');
      } else {
        this.onactive();
      }
      window.event.cancelBubble = true;
      return false;
    };
    var a = document.createElement('div');
    var e = DMap.$(a).addClass('icon');
    e.css({height: '28px'});
    b.append(e);
    b.attr({id: c.id, title: c.name});
    this.allTools[c.id] = b;
    if (c.pushed) {
      b.addClass('active');
    }
    b.appendTo(this._bar);
    if (c.pushGroup) {
      b.get(0).__pushGroup = c.pushGroup;
      var d = this._hash;
      var i = c.pushGroup;
      b.get(0).oncancelactive = function () {
        DMap.$(this).removeClass('active');
        if (c.onCancelActive) {
          c.onCancelActive();
        }
      };
      b.get(0).onactive = function () {
        var g = this;
        DMap.$(this.parentNode).children('.active[__pushGroup=' + g.__pushGroup + ']').filter(function () {
          return this !== g;
        }).each(function () {
          this.oncancelactive();
        });
        DMap.$(this).addClass('active');
        if (c.onActive) {
          c.onActive();
        }
      };
    }
    if (c.onPress) {
      b.get(0).onpress = c.onPress;
    }
    DMap.$(this).bind('clear', function () {
      b.unbind();
    });
    return b;
  },
  getTool: function (a) {
    return this.allTools[a];
  },
  draw: function (b) {
    var a = this;
    a._map = b;
    DMap.$('.map-tbar', this._map._dom).append(this._dom);
    a._map._setTopBarHeight(27);
  },
  remove: function () {
    this._map._setTopBarHeight(0);
    DMap.$(this).trigger('clear');
    this._bar.children().each(function () {
      DMap.$(this).unbind();
      this.onpress = null;
      this.onactive = null;
      this.oncancelactive = null;
      this.onmouseover = null;
      this.onmouseout = null;
      this.onmouseup = null;
      this.onmousedown = null;
    });
    DMap.$(document).unbind('._toolbar' + this.rm);
    var a = document.getElementById('orphanContent');
    if (!a) {
      a = document.createElement('div');
      a.id = 'orphanContent';
      document.body.appendChild(a);
    }
    a.appendChild(this._dom.get(0));
    a.innerHTML = '';
    this._dom = null;
    this._dragHandle = null;
    this._bar = null;
    this.rm = null;
    for (var b in this.allTools) {
      this.allTools[b] = null;
    }
    this.allTools = {};
    DMap.$(this).unbind('clear');
    this._map = null;
  }
});
DMap.Class('ScaleControl', DMap.Control, {
  containerDiv: null, initialize: function () {
    this.containerDiv = document.createElement('div');
  }, setPosition: function (d, b, c, a) {
    DMap.$(this.containerDiv).css({left: d, right: b, top: c, bottom: a});
  }, draw: function (b) {
    var a = this;
    a._map = b;
    DMap.$(a._map).bind('leftPanelControlShow.ScaleControl', function (d, c) {
      a.setPosition(c + 10, null, null, '10px');
    });
    DMap.$(a._map).bind('leftPanelControlHide.ScaleControl', function (d, c) {
      a.setPosition(c + 10, null, null, '10px');
    });
    DMap.$(this.containerDiv).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '10px',
      bottom: '10px',
      width: '100px',
      height: '13px',
      fontSize: '12px',
      color: '#030303',
      paddingLeft: '28px',
      borderBottom: '2px solid #030303',
      borderLeft: '2px solid #030303',
      borderRight: '2px solid #030303'
    });
    a.compScale(a._map);
    DMap.$(a._map).bind('zoomend', function (f, d, c) {
      a.compScale(a._map);
    });
    DMap.$(this.containerDiv).appendTo(a._map._paneDom);
  }, compScale: function (f) {
    if (!f) {
      return;
    }
    if (DCMapServer.GlobeParams.MapProjection == 0) {
      var b = f.resolutions[f.getZoom()] * 100;
      var a = b / (360 / (2 * Math.PI * 6378137));
      scale = Math.round(a * 100) / 100;
      scale = parseInt(scale);
    } else {
      if (DCMapServer.GlobeParams.MapProjection == 1 || DCMapServer.GlobeParams.MapProjection == 2 || DCMapServer.GlobeParams.MapProjection == 3) {
        var b = f.resolutions[f.getZoom()];
        var a = b * 96 / 0.0254;
        scale = Math.round(a * 100) / 100;
        scale = parseInt(scale);
      }
    }
    var g = this.changeNum(scale);
    var e = parseInt((g / scale) * 100);
    var c = parseInt(e / 3);
    var d = g + gisapi.DMap_activateMeaturePolyline_text;
    if (g.length > 3) {
      d = g.substring(0, g.length - 3) + gisapi.DMap_activateMeaturePolyline_text_km;
    }
    this.containerDiv.innerHTML = d;
    DMap.$(this.containerDiv).css({width: 100, paddingLeft: c});
  }, changeNum: function (num) {
    var _num = (num + '').substring(0, 2);
    var aft = '';
    for (var i = 0; i < (num + "").length - 2; i++) {
      aft += 0;
    }
    var bre = 10;
    var comp = [10, 20, 50, 100];
    with (Math) {
      for (var i = 0; i < comp.length; i++) {
        if (Math.abs(_num - comp[i]) >= abs(_num - comp[i + 1])) {
          bre = comp[i + 1];
        } else {
          break;
        }
      }
    }
    return bre + aft;
  }, hide: function () {
    DMap.$(this.containerDiv).css('visibility', 'hidden');
  }, show: function () {
    DMap.$(this.containerDiv).css('visibility', 'visible');
  }, remove: function () {
    DMap.$(this._map).unbind('.ScaleControl');
    DMap.Util.removeNode(this.containerDiv);
    this.containerDiv = null;
    this._map = null;
  }
});
DMap.Class('CopyrightControl', DMap.Control, {
  containerDiv: null, initialize: function () {
    this.containerDiv = document.createElement('div');
  }, setPosition: function (d, b, c, a) {
    DMap.$(this.containerDiv).css({left: d, right: b, top: c, bottom: a});
  }, draw: function (b) {
    var a = this;
    a._map = b;
    DMap.$(a._map).bind('leftPanelControlShow.ScaleControl', function (d, c) {
      a.setPosition(c + 10, null, null, '10px');
    });
    DMap.$(a._map).bind('leftPanelControlHide.ScaleControl', function (d, c) {
      a.setPosition(c + 10, null, null, '10px');
    });
    DMap.$(this.containerDiv).css({
      overflow: 'hidden',
      position: 'absolute',
      left: '160px',
      bottom: '10px',
      width: '400px',
      height: '13px',
      fontSize: '12px',
      color: '#030303',
      paddingLeft: '28px',
      '-moz-user-select': 'none'
    });
    this.containerDiv.innerHTML = DCMapServer.GlobeParams.Copyright;
    this.containerDiv.onselectstart = function () {
      return false;
    };
    DMap.$(this.containerDiv).appendTo(a._map._paneDom);
  }, hide: function () {
    DMap.$(this.containerDiv).css('visibility', 'hidden');
  }, show: function () {
    DMap.$(this.containerDiv).css('visibility', 'visible');
  }, remove: function () {
    DMap.$(this._map).unbind('.CopyrightControl');
    DMap.Util.removeNode(this.containerDiv);
    this.containerDiv = null;
    this._map = null;
  }
});
DMap.Class('MapTypeControl', DMap.Control, {
  _dom: null, _map: null, _excludeNames: null, initialize: function (a) {
    this._excludeNames = ',' + (a || ['MapType']) + ',';
  }, draw: function (b) {
    var a = this;
    a._map = b;
    this._dom = document.createElement('div');
    DMap.$(this._dom).css({
      position: 'absolute',
      right: '35px',
      top: '20px',
      color: 'black',
      fontSize: 'small',
      height: '19px'
    });
    DMap.$('#' + a._map._viewportId).append(this._dom);
    a.initTypeButtons();
    DMap.$(b).bind('addmaptype.MapTypeControl', function (c) {
      a.initTypeButtons();
    });
    DMap.$(b).bind('removemaptype.MapTypeControl', function (c) {
      a.initTypeButtons();
    });
    DMap.$(b).bind('maptypechanged.MapTypeControl', function (c) {
      a.initTypeButtons();
    });
    DMap.$(this._dom).preventBubbles('mousedown mouseup click');
  }, initTypeButtons: function () {
    DMap.$('*', this._dom).remove();
    var d = this;
    var a = this._map.getMapTypeArray();
    var f = new Array();
    for (var c = 0; c < a.length; c++) {
      var b = a[c].getName();
      if (this._excludeNames.indexOf(',' + b + ',') > -1) {
        continue;
      }
      var e = d.createButton_(b);
      e.mapTypeName = b;
      e.setAttribute('title', a[c].getName());
      if (this._map.getCurrentMapType().getName() == b) {
        d.toggleButton_(e);
      }
      this._dom.appendChild(e);
      f.push(e);
    }
    for (var c = 0; c < f.length; c++) {
      DMap.$(f[c]).bind('click', function () {
        d.resetButton_(f);
        d.toggleButton_(this);
      });
    }
  }, resetButton_: function (b) {
    for (var a = 0; a < b.length; a++) {
      b[a].style.fontWeight = '';
      b[a].style.border = '1px solid black';
    }
  }, toggleButton_: function (c) {
    c.style.fontWeight = 'bold';
    c.style.border = '1px solid #757575';
    c.style.backgroundColor = '#FFE9C0';
    var a = this._map.getMapTypeArray();
    for (var b = 0; b < a.length; b++) {
      if (a[b].getName() == c.mapTypeName) {
        this._map.setMapType(a[b]);
      }
    }
  }, createButton_: function (c) {
    var b = document.createElement('div');
    this.setButtonStyle_(b);
    b.style.cssFloat = 'left';
    b.style.styleFloat = 'left';
    var a = document.createElement('div');
    a.appendChild(document.createTextNode(c));
    a.style.width = '70px';
    a.style.paddingTop = '2px';
    b.appendChild(a);
    return b;
  }, setButtonStyle_: function (a) {
    a.style.color = '#000000';
    a.style.backgroundColor = 'white';
    a.style.border = '1px solid black';
    a.style.padding = '0px';
    a.style.margin = '0px';
    a.style.textAlign = 'center';
    a.style.fontSize = '12px';
    a.style.cursor = 'pointer';
  }, hide: function () {
    DMap.$(this._dom).css('visibility', 'hidden');
  }, show: function () {
    DMap.$(this._dom).css('visibility', 'visible');
  }, remove: function () {
    DMap.$(this._map).unbind('.MapTypeControl');
    DMap.Util.removeNode(this._dom);
    this._dom = null;
    this._map = null;
  }
});
DMap.Class('SlidebarControl', {
  initialize: function (a) {
    a = a || {};
    this.width = a.width || 250;
    this.height = a.height || '100%';
    this.anchor = a.anchor || 'right';
    if (a.isActive == undefined || a.isActive == true) {
      this.isActive = true;
    } else {
      this.isActive = a.isActive || false;
    }
  }, draw: function (e) {
    this._map = e;
    var f = DMap.$('<div/>');
    var g = DMap.$('<div class="slidebar" style="overflow:visible;right:-' + this.width + 'px; width:' + 0 + 'px; height:100%;"><div class="slidebar-ear" id="slidebarResult"><div class="slidebar-title"  style="font-size: 12px; width:1.5em; float:right; line-height:2em; text-align:center; "></div></div><div class="slidebar-content" style="overflow:auto; position:absolute; width:100%; height:100%; border:1px solid #A3C5E8; background:#EFF5F4;"></div></div>').appendTo(f);
    f.css({position: 'absolute', background: 'transparent', right: 0, width: 0, height: '100%'});
    this.body = g.get(0);
    var b = this;
    var a = function (c) {
      if (c === g.get(0) || c == null) {
        return true;
      }
      if (DMap.$(c).parents('.slidebar').length) {
        return true;
      }
    };
    g.hover(function (c) {
      if (a(c.fromElement) && a(c.toElement)) {
        return;
      }
      if (b.isActive) {
        b.slideOut();
      }
    }, function (c) {
      if (a(c.fromElement) && a(c.toElement)) {
        return;
      }
      if (b.isActive) {
        b.slideIn();
      }
    });
    g.bind('mousewheel', function (c) {
      c.stopPropagation();
    });
    g.preventBubbles('mousedown mouseup click');
    f.appendTo(e._paneDom);
    this._dom = f.get(0);
    if (!b.isActive) {
      DMap.$('#slidebarResult').toggle(function (c) {
        DMap.$(b).trigger('slidebar_out');
        b.slideOut();
      }, function (c) {
        DMap.$(b).trigger('slidebar_in');
        b.slideIn();
      });
    }
  }, show: function () {
    DMap.$(this._dom).show();
  }, hide: function () {
    DMap.$(this._dom).hide();
  }, getContentDiv: function () {
    return DMap.$(this._dom).find('.slidebar-content').get(0);
  }, setPosition: function (d, b, c, a) {
    DMap.$(this._dom).css({left: d, right: b, top: c, bottom: a});
  }, slideOut: function () {
    DMap.$(this.body).stop().animate({right: 0}, 'slow');
    this.expanded = true;
    DMap.$('.slidebar').css({position: 'absolute', right: -this.width + 'px', width: this.width + 'px'});
  }, slideIn: function () {
    DMap.$(this.body).stop().animate({right: -this.width + 'px'}, 'slow');
    this.expanded = false;
    DMap.$('.slidebar').css({position: '', right: '0px', width: 0 + 'px'});
  }, setTitle: function (a) {
    DMap.$(this._dom).find('.slidebar-title').text(a);
  }, remove: function () {
    this._dom.parentNode.removeChild(this._dom);
    this._dom = null;
  }
});
DMap.Class('MousePositionControl', DMap.Control, {
  _map: null, initialize: function () {
    this._dom = null;
  }, draw: function (b) {
    var a = this;
    a._map = b;
    this._dom = document.createElement('div');
    a._map.getContainer().appendChild(this._dom);
    DMap.$(this._dom).attr('unselectable', 'on').css({
      position: 'absolute',
      right: '3px',
      bottom: '2px',
      color: 'blue'
    });
    DMap.$(a._map).bind('mousemove.MousePositionControl', function (d, c) {
      a._dom.innerHTML = gisapi.MousePositionControl_lon + ':' + c.lon + ',' + gisapi.MousePositionControl_lat + ':' + c.lat + ',' + gisapi.MousePositionControl_zoom + ':' + a._map.getZoom();
    });
  }, remove: function () {
    DMap.$(this._map).unbind('.MousePositionControl');
    DMap.Util.removeNode(this._dom);
    this._dom = null;
    this._map = null;
  }, CLASS_NAME: 'DMap.MousePositionControl'
});
DMap.Class('TrafficControl', DMap.Control, {
  idPrefix: null, containerDiv: null, initialize: function () {
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
    }
    this.scriptRequest();
  }, getStyle: function (b, a) {
    b = document.getElementById(b);
    var c = b.style[a] || (b.currentStyle ? b.currentStyle[a] : '') || this.getComputedStyle(b, a);
    return c;
  }, _popUpDiv: function (b) {
    var b = this;
    var a = setBar(b);
  }, getPosition: function (a) {
    var b = {left: 0, top: 0};
    while (a && a.offsetParent) {
      b.left += a.offsetLeft;
      b.top += a.offsetTop;
      a = a.offsetParent;
    }
    return b;
  }, scriptRequest: function () {
    var d = {};
    d.proxyurl = 'http://localhost:8080/EHL_MapClient/testData/traffic.xml';
    var a = '';
    var b = '';
    var c = this;
    DMap.$.ajax({
      url: '../../DcProxy',
      data: d,
      type: 'post',
      async: false,
      dataType: 'xml',
      cache: false,
      success: function (e) {
        DMap.$(e).find('traffic').each(function () {
          c._currentTime = DMap.$(this).find('time').text();
          c._url = DMap.$(this).find('url').text();
        });
      }
    });
  }, setPosition: function (d, b, c, a) {
    DMap.$(this.containerDiv).css({left: d, right: b, top: c, bottom: a});
  }, draw: function (c) {
    var b = this;
    b._map = c;
    this.containerDiv = DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
      position: 'absolute',
      left: '0px',
      top: '0px',
      zIndex: '201'
    });
    var a = document.getElementById(this._map._panelContainerId);
    a.appendChild(this.containerDiv);
    DMap.$(this.containerDiv).css({
      position: 'absolute',
      left: '300px',
      bottom: '20px',
      width: '247px',
      height: '58px'
    });
    DMap.$(this.containerDiv).appendTo(b._map._paneDom);
  }, showRealLL: function () {
    var b = this;
    if (b.timer) {
      clearInterval(b.timer);
    }
    b.timer = setInterval(function () {
      b.scriptRequest();
    }, 1000 * 5);
    DMap.$(this.containerDiv).empty();
    var d = m_mapgis + '/lib/images/maptoolbar/GenericRefresh16.png';
    var c = this._currentTime || new Date().getHours() + ':' + new Date().getMinutes();
    var a = '<div class="maplibTc" id="tcWrap"><div class="maplibTcColor" id="tcTitle">' + gisapi.trraficLiuLiang + '</div>';
    a += '<div id="tcRealTime" >' + gisapi.trraficUpdateTime + c + '<img src=\'' + d + '\' onclick="javascript:void(alert(123))" alt=' + gisapi.trraficUpdate + '/>';
    a += '<button class="maplibTcClose" id="tcClose" ></button></div></div>';
    DMap.$(this.containerDiv).append(a);
  }, showHistoryLL: function () {
    DMap.$(this.containerDiv).empty();
    this.weekday = new Date().getDay() == 0 ? 7 : new Date().getDay();
    var a = '<div class="maplibTc" id="tcWrap"><div class="maplibTcColor" id="tcTitle">' + gisapi.trraficLiuLiang + '<div class="maplibTcTime">';
    a += '<span id="maplibTcDay" class="maplibTcCurTime"></span><span class="maplibTcColon">:&nbsp;</span><span class="maplibTcCurTime" id="tcNow"></span></div><button class="maplibTcClose" id="tcClose" ></button>';
    a += '<div class="maplibTcWeekDay"><span>' + gisapi.trraficWeek + '</span><ul id="tcWeek"><li><a lang="1" href="javascript:void(0)">' + gisapi.trraficMonday + '</a></li><li><a lang="2" href="javascript:void(0)">' + gisapi.trraficTuesday + '</a></li><li><a lang="3" href="javascript:void(0)">' + gisapi.trraficWednesday + '</a></li><li><a lang="4" href="javascript:void(0)">' + gisapi.trraficThursday + '</a></li><li><a lang="5" href="javascript:void(0)">' + gisapi.trraficFriday + '</a></li><li><a lang="6" href="javascript:void(0)">' + gisapi.trraficSaturday + '</a></li><li><a lang="7" href="javascript:void(0)">' + gisapi.trraficSunday + '</a></li></ul></div></div>';
    a += '<div class="maplibTcRuleTxt">' + gisapi.trraficTime + '</div><div class="maplibTcRule"><div class="maplibTcTimeBox" id="tcTimeBox">20:00</div>';
    a += '<div class="maplibTcTimelinePrev" id="tcPrev"></div><div class="maplibTcTimeMove" id="tcMove"></div><div class="maplibTcTimelineNext" id="tcNext"></div><br><br>';
    a += '<div class="maplibTcClear" style="text-align: center; color: #ccc;">' + gisapi.trraficMessage + '</div></div>';
    DMap.$(this.containerDiv).append(a);
    this._popUpDiv(this);
  }, hide: function () {
    DMap.$(this.containerDiv).css('visibility', 'hidden');
  }, show: function () {
    DMap.$(this.containerDiv).css('visibility', 'visible');
  }, closePopDiv: function (d) {
    DMap.$(a).unbind();
    var c = this;
    var a = document.getElementById('tcClose');
    var b = document.getElementById('tcWrap');
    DMap.$(a).bind('click', function () {
      DMap.$(b).css({display: 'none'});
      if (d != null) {
        c._map.removeOverlay(d);
        d = null;
      }
    });
  }, remove: function () {
  }
});

function setBar(j) {
  var c;
  var g = [gisapi.trraficMonday, gisapi.trraficTuesday, gisapi.trraficWednesday, gisapi.trraficThursday, gisapi.trraficFriday, gisapi.trraficSaturday, gisapi.trraficSunday];
  var e = document.getElementById('tcTimeBox');
  var m = document.getElementById('tcMove');
  var b = document.getElementById('tcPrev');
  var k = document.getElementById('tcNext');
  var p = document.getElementById('maplibTcDay');
  var d = document.getElementById('tcNow');
  var i = true;

  function l(q) {
    DMap.$(document).bind('mousemove.traffic', o);
    DMap.$(document).bind('mouseup.traffic', a);
    if (q && q.preventDefault) {
      q.preventDefault();
    } else {
      window.event.returnValue = false;
    }
    return false;
  }

  function o(t) {
    var q = t.clientX || t.x;
    var s = j.getPosition(b).left + 9;
    var r = q - s - 4;
    if (r < 0) {
      r = 0;
    }
    if (r > 165) {
      r = 165;
    }
    m.style.marginLeft = r + 'px';
    e.style.marginLeft = (r) + 'px';
    h();
  }

  function a() {
    DMap.$(document).unbind('.traffic');
    p.innerHTML = gisapi.trraficWeek + g[j.weekday - 1];
    d.innerHTML = e.innerHTML;
  }

  DMap.$(m).bind('mousedown', l);
  DMap.$(b).bind('click', function () {
    n('prev');
  });
  DMap.$(k).bind('click', function () {
    n('next');
  });

  function n(q) {
    var r = e;
    var s = parseInt(j.getStyle('tcTimeBox', 'marginLeft'));
    var t = Math.ceil((s - 4) * 24 / 165);
    f(q == 'next' ? (t + 1) : (t - 1));
    d.innerHTML = e.innerHTML;
  }

  this.setBarTime = function (q) {
    f(q);
  };

  function f(r) {
    if (r < 0) {
      r = 0;
    }
    if (r > 24) {
      r = 24;
    }
    c = r;
    var q = r * (165 / 24);
    e.style.marginLeft = q + 'px';
    m.style.marginLeft = q + 'px';
    j.hour = c;
    p.innerHTML = gisapi.trraficWeek + g[j.weekday - 1];
    d.innerHTML = e.innerHTML;
    if (i) {
    } else {
    }
    h();
  }

  function h() {
    var q = parseInt(e.style.marginLeft);
    var r = Math.ceil((q - 4) * 24 / 165);
    c = r;
    j.hour = r;
    if (r < 10) {
      r = '0' + r;
    }
    if (i) {
      e.innerHTML = r + ':00';
    } else {
    }
  }
};
DMap.Class('TileLayer', DMap.Overlay, {
  idPrefix: null,
  _dom: null,
  _map: null,
  tileSize: null,
  resolutions: null,
  maxBounds: null,
  tileUrlTemplate: null,
  maxRowsAndColsArray: null,
  tileLonLatSizeArray: null,
  initialize: function (c) {
    try {
      this.childFeature = [];
      this.tileUrlTemplate = (Object.prototype.toString.apply(c) === '[object Array]') ? c : [c];
      var d = new String(DCMapServer.GlobeParams.MapFullExtent).split(',');
      var b = new DMap.LonLatBounds(new Number(d[0]), new Number(d[1]), new Number(d[2]), new Number(d[3]));
      if (DCMapServer.GlobeParams.MapCoordinate == 0) {
        this.fullBounds = b;
        var a = new String(DCMapServer.GlobeParams.MapGolbeBounds).split(',');
        this.maxBounds = new DMap.LonLatBounds(new Number(a[0]), new Number(a[1]), new Number(a[2]), new Number(a[3]));
      } else {
        if (DCMapServer.GlobeParams.MapCoordinate == 1) {
        } else {
          if (DCMapServer.GlobeParams.MapCoordinate == 2) {
          } else {
            if (DCMapServer.GlobeParams.MapCoordinate == 3) {
              this.fullBounds = b;
              var a = new String(DCMapServer.GlobeParams.MapGolbeBounds).split(',');
              this.maxBounds = new DMap.LonLatBounds(new Number(a[0]), new Number(a[1]), new Number(a[2]), new Number(a[3]));
            }
          }
        }
      }
      var g = DCMapServer.GlobeParams.MapUnitPixels;
      this.tileSize = new DMap.Size(g, g) || new DMap.Size(128, 128);
      DMap.$(this).bind('tileload', function () {
        if (!--this.nLoading) {
          DMap.$(this).trigger('load');
          this.loaded = true;
        }
      });
      this.level = -1;
    } catch (f) {
      throw DMap.EhlException.createError(gisapi.tileLayerError, f);
    }
  },
  setLevel: function (a) {
    if (this.level != a) {
      this.clearTiles();
    }
    this.level = a;
    this._dom.attr('level', a);
  },
  lockLevel: function (a) {
    this.lock = a;
  },
  getDoms: function () {
    return this._dom.get(0);
  },
  draw: function (e) {
    var d = this;
    this._map = e;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var c = document.getElementById(this._map._panelContainerId);
      c.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '88'
      }));
    }
    d._map.isZoomend = true;
    d.drawFront();
    this.resolutions = this._map.resolutions;
    this.maxRowsAndColsArray = [];
    this.tileLonLatSizeArray = [];
    this.initMaxRowsAndColsArray();
    DMap.$(this).bind('zoomend', function () {
      if (d._backdom) {
        d._backdom.remove();
        d._backdom = null;
      }
      d._dom.show();
    });
    DMap.$(this).bind('load', function () {
      if (d._map.isZoomend) {
        d._dom.show();
      }
    });
    if (this.otherTitleUrl && this.otherTitleUrl.length > 0) {
      for (var b = 0; b < this.otherTitleUrl.length; b++) {
        var a = new DMap.TileLayer(this.otherTitleUrl[b]);
        d._map.addOverlay(a);
        this.childFeature.push(a);
      }
    }
    this.refresh();
  },
  drawFront: function () {
    this._dom = DMap.$('<div/>').css({
      position: 'absolute',
      left: 0,
      top: 0,
      '-moz-user-select': 'none'
    }).appendTo('#' + this.idPrefix);
    this._pool = {};
  },
  initMaxRowsAndColsArray: function () {
    var b = this;
    var a = this.maxBounds.toLonLatSize();
    DMap.$.each(this.resolutions, function (d, e) {
      var c = new DMap.LonLatSize(DMap.PRECISION * b.resolutions[d] * b.tileSize.w / DMap.PRECISION, DMap.PRECISION * b.resolutions[d] * b.tileSize.h / DMap.PRECISION);
      b.maxRowsAndColsArray[d] = [Math.ceil(a.w / c.w), Math.ceil(a.h / c.h)];
      // window.console.debug(b.maxRowsAndColsArray[d]); // TODO 屏蔽打印
      b.tileLonLatSizeArray[d] = c;
      // window.console.debug(c); // TODO 屏蔽打印
    });
  },
  getTileLonLatSize: function (a) {
    return this.tileLonLatSizeArray[a];
  },
  fromTileToDivLeftTopPixel: function (c, b) {
    var a = this._map.fromLonLatToDivPixel(this.maxBounds.wn(), b);
    return a.add(c[0] * this.tileSize.w, c[1] * this.tileSize.h);
  },
  fromTileToDivLeftTopLonlat: function (c, b) {
    var a = this.fromTileToDivLeftTopPixel(c, b);
    return this._map.fromDivPixelToLonLat(a, b);
  },
  fromDivLeftTopPixelToTilesRange: function (a, b, i) {
    var c = this._map.fromDivPixelToLonLat(b, i);
    var g = this.getTileLonLatSize(i);
    var d = Math.floor((c.lon - this.maxBounds.left) * DMap.PRECISION / (g.w * DCMapServer.GlobeParams.MapCoordinateType * DMap.PRECISION));
    var f = Math.floor((this.maxBounds.top - c.lat) * DMap.PRECISION / (g.h * DCMapServer.GlobeParams.MapCoordinateType * DMap.PRECISION));
    if (DCMapServer.GlobeParams.MapCoordinateType != 1) {
      f = f - 1;
    }
    var e = Math.floor((c.lon + a.w * this.resolutions[i] * DCMapServer.GlobeParams.MapCoordinateType - this.maxBounds.left) * DMap.PRECISION / (g.w * DCMapServer.GlobeParams.MapCoordinateType * DMap.PRECISION));
    var h = Math.floor((this.maxBounds.top - c.lat + a.h * this.resolutions[i] * DCMapServer.GlobeParams.MapCoordinateType) * DMap.PRECISION / (g.h * DCMapServer.GlobeParams.MapCoordinateType * DMap.PRECISION));
    return new DMap.TilesRange(d, f, e, h);
  },
  tileCheckRange: function (c, b) {
    var a = this.maxRowsAndColsArray[b];
    if (c[0] >= 0 && c[0] < a[0] && c[1] >= 0 && c[1] < a[1]) {
      return true;
    } else {
      return false;
    }
  },
  _getTilesRange: function () {
    var a = document.getElementById(this._map._panelContainerId).style;
    var d = parseInt(a.left);
    var c = parseInt(a.top);
    var b = this.fromDivLeftTopPixelToTilesRange(this._map.getSize(), new DMap.Pixel(-d, -c), this._map.getZoom());
    return b;
  },
  redraw: function (b, g, k, c) {
    var h = this;
    if (this.childFeature) {
      for (var d = 0; d < this.childFeature.length; d++) {
        this.childFeature[d].redraw(b, g, k, c);
      }
    }
    this.loadTiles();
    return;
    if (b) {
      if (g == k) {
        this.initTiles(this._pool);
        return;
      }
      if (c) {
        if (!h._map.isZoomend) {
          return;
        }
        h.i = 1;
        h.n = 7;
        h._backdom = this._dom;
        this._dom = null;
        var j = this._pool;
        var l = h._map.getSize();
        var e = h._map.resolutions[g];
        var a = h._map.resolutions[h._map.getZoom()];
        var f = e / a;
        h._map.isZoomend = false;
        h._backdom.css('zIndex', 1);
        DMap.$('>:not(#' + h.idPrefix + ')', '#' + h._map._panelContainerId).hide();
        setTimeout(function () {
          h._map.zooming = true;
          if (h.i++ < h.n) {
            setTimeout(arguments.callee, 40);
            var p = h._map.resolutions[h._map.getZoom()];
            var m = e / p;
            var o = 1;
            if (m < 1) {
              m = Math.max(0.25, m);
              o = 1 - (1 - m) * h.i / h.n;
            } else {
              m = Math.min(4, m);
              o = 1 + (m - 1) * h.i / h.n;
            }
            if (o < 0.1) {
              h._backdom.hide();
            } else {
              if (DMap.$.browser.msie || DMap.$.browser.safari || DMap.$.browser.opera) {
                h._backdom.css({zoom: o});
              } else {
                h._backdom.css({MozTransform: 'scale(' + o + ')'});
              }
            }
          } else {
            for (var i in j) {
              var n = j[i];
              DMap.$(n).unbind();
              DMap.$(n).attr('src', 'about:blank');
              DMap.$(n).remove();
              n = null;
              j[i] = null;
            }
            h._map.isZoomend = true;
            DMap.$.each(DMap.$('#' + h._map._panelContainerId).children(), function (q) {
              DMap.$(this).show();
            });
            DMap.$.each(h._map._overlayArray, function (r, q) {
              if (!q.isShow()) {
                DMap.$('#' + this._map._panelMarkerId).hide();
              }
            });
            DMap.$(h).trigger('zoomend');
            h._map.zooming = false;
            h.loadTiles();
          }
        }, 40);
        this.drawFront();
        h._dom.hide();
      } else {
        this.refresh();
      }
    } else {
      this.loadTiles();
    }
  },
  remove: function () {
    if (this.childFeature) {
      for (var a = 0; a < this.childFeature.length; a++) {
        this._map.removeOverlay(this.childFeature[a]);
      }
    }
    this.clearTiles();
    if (this._dom && this._dom != null) {
      this._dom.remove();
      this._dom = null;
      this._map = null;
    }
    this.idPrefix = null;
  },
  copy: function () {
    return new DMap.TileLayer(this.tileUrlTemplate, this.maxBounds, this.tileSize);
  },
  refresh: function () {
    var a = this._map.getZoom();
    this.loadTiles();
  },
  clearTiles: function () {
    var c = this._pool;
    for (var a in c) {
      var b = c[a];
      DMap.$(b).unbind();
      DMap.$(b).attr('src', 'about:blank');
      DMap.$(b).remove();
      c[a] = null;
      b = null;
    }
    this.tileRange = null;
    this._pool = {};
  },
  loadTiles: function () {
    if (!this._map) {
      return;
    }
    var j = this._map.getZoom();
    this.setLevel(j);
    var b = this._getTilesRange();
    if (this.tileRange && this.tileRange.equals(b)) {
      return;
    }
    this.tileRange = b;
    this.nLoading = 0;
    var h = this._pool;
    var e = {};
    var d = {};
    for (var a = b.minRow; a <= b.maxRow; a++) {
      for (var i = b.minCol; i <= b.maxCol; i++) {
        var f = a + '_' + i;
        var g = h[f];
        if (g) {
          e[f] = g;
          delete h[f];
        } else {
          this.nLoading++;
          g = this._createTileImg([a, i], j);
          this._dom.append(g);
          d[f] = g;
          e[f] = g;
        }
      }
    }
    this.initTiles(d);
    for (var f in d) {
      d[f] = null;
    }
    for (var f in h) {
      var g = h[f];
      g.parentNode.removeChild(g);
      DMap.$(g).unbind();
      g.src = 'about:blank';
      g = null;
      h[f] = null;
    }
    this._pool = e;
  },
  initTiles: function (i) {
    var j = this.tileSize.w;
    var e = this.tileSize.h;
    var f = 0;
    var c = 0;
    for (var a in i) {
      var d = i[a];
      var g = a.split('_');
      g[0] = Number(g[0]);
      g[1] = Number(g[1]);
      var b = this.fromTileToDivLeftTopPixel(g);
      d.style.left = b.x + f + 'px';
      d.style.top = b.y + c + 'px';
      d.style.width = j + 'px';
      d.style.height = e + 'px';
      d = null;
    }
  },
  _getServerImageUrl: function (c, b) {
    var a = this.tileUrlTemplate + '&Service=getImage&x=' + c[0] + '&y=' + c[1] + '&Zoom=' + b;
    return a;
  },
  _createTileImg: function (e, d) {
    var a = null;
    if (needPngFix) {
      a = document.createElement('div');
      a.style.position = 'absolute';
      var c = this;
      DMap.$(a).hide();
      DMap.$(a).bind('load', c, function (f) {
        DMap.$(this).unbind();
        DMap.$(this).show();
        DMap.$(f.data).trigger('tileload');
      });
      var b = this._getServerImageUrl(e, d);
      DMap.$(a).css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,enabled=true,src=\'' + b + '\')'}).show();
      a.src = b;
    } else {
      a = document.createElement('img');
      a.style.position = 'absolute';
      var c = this;
      DMap.$(a).hide();
      DMap.$(a).bind('load', c, function (f) {
        DMap.$(this).unbind();
        DMap.$(this).show();
        DMap.$(f.data).trigger('tileload');
      });
      var b = this._getServerImageUrl(e, d);
      a.src = b;
    }
    a.unselectable = 'on';
    a.onmousedown = function (f) {
      if (f && f.preventDefault) {
        f.preventDefault();
      }
      return false;
    };
    return a;
  },
  CLASS_NAME: 'DMap.TileLayer'
});
DMap.Class('MapType', DMap.TileLayer, {
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    this.otherTitleUrl = [];
    if (a) {
      this.otherTitleUrl = a;
    }
    DMap.TileLayer.prototype.initialize.apply(this, arguments);
    this._typeName = b || 'MapType:' + DMap.Util.createUniqueID();
    this._url = c;
  }, getName: function () {
    return this._typeName;
  }, getUrl: function () {
    return this._url;
  }, copy: function () {
    return new DMap.MapType(this.tileUrlTemplate, this._typeName);
  }, CLASS_NAME: 'DMap.MapType'
});
DMap.Class('ThemeLayer', DMap.Overlay, {
  idPrefix: null,
  _dom: null,
  isInit: false,
  theme: null,
  paramenters: null,
  _map: null,
  urlTemplate: null,
  imageversion: null,
  interval: 5 * 1000,
  isStartFresh: false,
  freshStatus: 0,
  initialize: function (a) {
    if (typeof(THEME_SERVER) == 'undefined') {
      alert(gisapi.themeServerError);
      return;
    }
    if (!a.themeId && !a.dataUrl) {
      alert(gisapi.themeParamentersError);
      return;
    }
    if (a.minZoom) {
      this.setMinZoom(a.minZoom);
    }
    if (a.maxZoom) {
      this.setMaxZoom(a.maxZoom);
    }
    if (a.interval) {
      this.interval = a.interval;
    }
    if (a.themeId) {
      this.urlTemplate = THEME_SERVER + 'themeServlet?BOX={BOX}&WIDTH={WIDTH}&HEIGHT={HEIGHT}&FORMAT=PNG&THEMEID=' + a.themeId + '&RESOLUTION={RESOLUTION}';
    } else {
      this.urlTemplate = THEME_SERVER + 'themeServlet?BOX={BOX}&WIDTH={WIDTH}&HEIGHT={HEIGHT}&FORMAT=PNG&URL=' + a.dataUrl + '&RESOLUTION={RESOLUTION}';
    }
    if (a.interval) {
      this.isStartFresh = true;
    }
    this.paramenters = a;
    this.lastLayer = null;
    this.features = [];
    this.click = null;
    if (a.click) {
      this.click = a.click;
    }
    this.userMapId = DMap.Util.createUniqueID('THEMELAYERMAPID');
    this.isLoaded = false;
    this.isHideImg = true;
    if (a.noDataColor) {
      this.noDataColor = a.noDataColor;
    }
  },
  loadThemeConfig: function () {
    var b = {};
    b.themeid = themeid;
    var a = '/ajaxServlet?class=ThemeManager&method=searchTheme';
    jQuery.ajax({
      type: 'post', url: a, data: b, async: true, cache: false, success: function (c) {
      }, error: function (c) {
      }
    });
  },
  getDoms: function () {
    return this._dom;
  },
  draw: function (b) {
    var a = this;
    a._map = b;
    this.initDom();
    this.isInit = true;
    this.redraw();
  },
  initDom: function () {
    var d = this;
    var b = d._map.getSize();
    if (d._dom) {
      return;
    }
    if (needPngFix && (this.urlTemplate.toUpperCase().indexOf('FORMAT=PNG') > 0)) {
      d._dom = document.createElement('div');
    } else {
      d._dom = document.createElement('img');
    }
    DMap.$(d._dom).css({
      position: 'absolute',
      border: '0px none',
      margin: '0px',
      padding: '0px',
      zIndex: 0,
      width: b.w,
      height: b.h
    });
    DMap.$(d._dom).bind('load', function () {
      d._onloadImage();
      if (d.isStartFresh) {
        d.startRefresh();
      }
    });
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var c = DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '101'
      });
      document.getElementById(this._map._panelContainerId).appendChild(c);
    }
    d._dom.id = 'img_' + this.idPrefix;
    DMap.$('#' + this.idPrefix)[0].appendChild(d._dom);
    var a = DMap.$('<map style="position:absolute;z-Index:110" id="' + this.userMapId + '" name="' + this.userMapId + '"></map>');
    DMap.$('#' + this.idPrefix).append(a);
  },
  clearDom: function () {
    if (this.idPrefix) {
      DMap.$('#' + this.idPrefix).empty();
      this._dom = null;
    }
  },
  _onloadImage: function () {
    var a = this._map.fromLonLatToDivPixel(this._map.getBounds().wn());
    this._dom.style.left = a.x + 'px';
    this._dom.style.top = a.y + 'px';
    DMap.$(this._dom).show();
    this._map.resume();
    if (DMap.$.browser.msie || DMap.$.browser.safari || DMap.$.browser.opera) {
      DMap.$('#' + this.idPrefix).css({zoom: 1});
    } else {
      DMap.$('#' + this.idPrefix).css({MozTransform: 'scale(' + 1 + ')'});
    }
    this.isLoaded = true;
    this.isHideImg = true;
  },
  redraw: function (e, a, d, b) {
    this.isLoaded = false;
    var c = this;
    if (!this.isShow()) {
      DMap.$('#' + this.idPrefix).hide();
      return;
    } else {
      DMap.$('#' + this.idPrefix).show();
    }
    c.loadThemeData(e, a, d, b);
  },
  loadThemeData: function (b, g, j, c) {
    var h = this;
    var e = h._map.getBounds();
    var d = {callbacktype: 1};
    if (!this.click) {
      d.callbacktype = 0;
      var a = h.loadUrl(e);
      h.resetImg(a, b, g, j, c);
      return;
    }
    for (var f = 0; f < this.features.length; f++) {
      h._map.removeOverlay(this.features[f]);
    }
    this.features.length = 0;
    DMap.$.ajax({
      type: 'get',
      url: h.loadUrl(e),
      data: d,
      dataType: 'xml',
      async: false,
      cache: false,
      success: function (k) {
        var m = k.getElementsByTagName('image')[0];
        var i = m.getAttribute('url');
        var l = k.getElementsByTagName('callbackdata');
        h.resetImg(i, b, g, j, c);
        if (l.length > 0) {
          DMap.$('#' + h.userMapId).html(l[0].firstChild.nodeValue);
          DMap.$('#' + h.userMapId).children().each(function () {
            DMap.$(this).bind('click', h.click).bind('mouseover', function () {
              this.style.cursor = 'hand';
            }).bind('mouseout', function () {
              this.style.cursor = 'hand';
            });
          });
          DMap.$(h._dom).attr('usemap', '#' + h.userMapId);
        }
      }
    });
  },
  resetImg: function (d, h, a, g, c) {
    var f = this;
    var e = f._map.getSize();
    DMap.$(f._dom).css({width: e.w, height: e.h});
    if (needPngFix && (f.urlTemplate.toUpperCase().indexOf('FORMAT=PNG') > 0)) {
      var b = document.createElement('img');
      if (f.unloadImg) {
        f.unloadImg();
      }
      b.onload = function () {
        DMap.$(f._dom).css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=\'' + d + '\')'}).show();
        f._onloadImage();
        f.unloadImg();
      };
      f.unloadImg = function () {
        if (b != null) {
          b.src = '';
          b.onload = null;
          b = null;
          f.unloadImg = null;
        }
      };
      b.src = d;
      setTimeout(f.unloadImg, 3000);
    } else {
      if (f.isHideImg) {
        DMap.$(f._dom).hide();
      }
      f._dom.src = d;
    }
  },
  remove: function () {
    var a = this;
    if (a.unloadImg) {
      a.unloadImg();
    }
    if (this._dom != null) {
      DMap.Util.removeNode(this._dom);
    }
    if (this.idPrefix != null) {
      DMap.$('#' + this.idPrefix).remove();
    }
    this._dom = null;
    this.idPrefix = null;
  },
  copy: function () {
    return new DMap.ThemeLayer(this.urlTemplate);
  },
  loadUrl: function (c) {
    var f = this;
    var b = this._map.getSize();
    var e = this._map.getZoom();
    var d = Math.round(c.left * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(c.bottom * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(c.right * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(c.top * DMap.PRECISION) / DMap.PRECISION;
    var a = DMap.Util.buildTemplateStr(this.urlTemplate, {
      WIDTH: b.w,
      HEIGHT: b.h,
      MINX: Math.round(c.left * DMap.PRECISION) / DMap.PRECISION,
      MAXX: Math.round(c.right * DMap.PRECISION) / DMap.PRECISION,
      MINY: Math.round(c.bottom * DMap.PRECISION) / DMap.PRECISION,
      MAXY: Math.round(c.top * DMap.PRECISION) / DMap.PRECISION,
      BOX: d,
      RESOLUTION: f._map.resolutions[e]
    });
    a = this.loadLayerParamenters(a);
    return a + '&imageversion=' + new Date().getTime();
  },
  loadLayerParamenters: function (b) {
    var e = this._map.getZoom();
    var g = false;
    if (this.paramenters.zoomLayers) {
      for (var d = 0; d < this.paramenters.zoomLayers.length; d++) {
        var c = this.paramenters.zoomLayers[d];
        if (e == c.zoom) {
          this.lastLayer = c;
        }
      }
    }
    if (this.lastLayer != null) {
      if (this.lastLayer.layer) {
        b += '&themeLayer=' + this.lastLayer.layer;
      }
      if (this.lastLayer.stroke) {
        b += '&stroke=' + this.lastLayer.stroke;
      }
      for (var f in this.lastLayer) {
        var a = f;
        if (f == 'layer') {
          a = 'themeLayer';
        }
        b += '&' + a + '=' + this.lastLayer[f];
      }
    }
    if (this.noDataColor) {
      b += '&noDataColor=' + encodeURIComponent(this.noDataColor);
    }
    return b;
  },
  setStyle: function (e) {
    var d = this._map.getZoom();
    var c = this._map.getBounds();
    var b = this.lastLayer;
    if (b) {
      for (var f in e) {
        b[f] = e[f];
      }
      var a = this.loadUrl(c);
      this.resetImg(a);
    }
  },
  startRefresh: function (b) {
    this.isStartFresh = true;
    if (this.interval == null) {
      return;
    }
    if (b) {
      this.interval = b;
    }
    var a = this;
    if (a.freshStatus == 1) {
      return;
    }
    a.freshStatus = 1;
    window.setTimeout(function () {
      a.isHideImg = false;
      a.resetUrl();
      a.freshStatus = 0;
    }, this.interval);
  },
  stopRefresh: function (a) {
    this.isStartFresh = false;
  },
  resetUrl: function (a) {
    if (a) {
      this.urlTemplate = a;
    }
    this.imageversion = new Date().getTime();
    this.redraw();
  },
  refresh: function () {
    this.resetUrl();
  },
  CLASS_NAME: 'DMap.ThemeLayer'
});
DMap.ThemeLayer.onMouseOver = function (a) {
  alert(a);
};
DMap.Class('TrafficLayer', DMap.TileLayer, {
  _isHack: false, initialize: function (a) {
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException.isTypeRight(a, 'string');
    DMap.TileLayer.prototype.initialize.apply(this, arguments);
  }, setHack: function (a) {
    this._isHack = a;
  }, getHack: function () {
    return this._isHack;
  }, _getServerImageUrl: function (d, c) {
    var b = null;
    var a = this.tileUrlTemplate.toString().indexOf('?');
    if (this.getHack()) {
      if (a > -1) {
        b = this.tileUrlTemplate + 'z=' + c + '&y=' + d[1] + '&x=' + d[0] + '&t=1&date=' + Math.random();
      } else {
        b = this.tileUrlTemplate + '?cmd=100&z=' + c + '&y=' + d[1] + '&x=' + d[0] + '&t=1&date=' + Math.random();
      }
    } else {
      if (a > -1) {
        b = this.tileUrlTemplate + 'z=' + c + '&y=' + d[1] + '&x=' + d[0] + '&date=' + Math.random();
      } else {
        b = this.tileUrlTemplate + '?cmd=100&z=' + c + '&y=' + d[1] + '&x=' + d[0] + '&date=' + Math.random();
      }
    }
    window.console.debug(b);
    return b;
  }, CLASS_NAME: 'DMap.TrafficLayer'
});
DMap.Class('WMSLayer', DMap.Overlay, {
  idPrefix: null,
  _dom: null,
  _map: null,
  urlTemplate: null,
  imageversion: null,
  initialize: function (b, a) {
    DMap.EhlException.isTypeRight(b, 'undefined');
    DMap.EhlException.isTypeRight(b, 'string');
    this.urlTemplate = b + '?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&SRS=EPSG%3A4326&WIDTH={WIDTH}&HEIGHT={HEIGHT}&BBOX={MINX},{MINY},{MAXX},{MAXY}&LAYERS=' + a;
    this.imageversion = new Date().getTime();
  },
  getDoms: function () {
    return this._dom;
  },
  draw: function (d) {
    var c = this;
    c._map = d;
    var a = d.getSize();
    if (needPngFix && (this.urlTemplate.toUpperCase().indexOf('FORMAT=PNG') > 0)) {
      c._dom = document.createElement('div');
    } else {
      c._dom = document.createElement('img');
    }
    DMap.$(c._dom).css({
      position: 'absolute',
      border: '0px none',
      margin: '0px',
      padding: '0px',
      zIndex: 0,
      width: a.w,
      height: a.h
    });
    DMap.$(c._dom).bind('load', function () {
      c._onloadImage();
    });
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var b = DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '101'
      });
      document.getElementById(this._map._panelContainerId).appendChild(b);
      b.appendChild(c._dom);
    }
    this.redraw();
  },
  _onloadImage: function () {
    var a = this._map.fromLonLatToDivPixel(this._map.getBounds().wn());
    this._dom.style.left = a.x + 'px';
    this._dom.style.top = a.y + 'px';
    DMap.$(this._dom).show();
    this._map.resume();
  },
  redraw: function (e) {
    var d = this;
    DMap.$(d._dom).hide();
    var c = d._map.getBounds();
    if (DMap.$.browser.msie && (DMap.$.browser.version >= 5.5) && (DMap.$.browser.version < 7) && (d.urlTemplate.toUpperCase().indexOf('FORMAT=PNG') > 0)) {
      var a = document.createElement('img');
      var b = d.loadUrl(c);
      if (d.unloadImg) {
        d.unloadImg();
      }
      a.onload = function () {
        DMap.$(d._dom).css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=\'' + b + '\')'}).show();
        d._onloadImage();
        d.unloadImg();
      };
      d.unloadImg = function () {
        if (a != null) {
          a.src = '';
          a.onload = null;
          a = null;
          d.unloadImg = null;
        }
      };
      a.src = b;
      setTimeout(d.unloadImg, 3000);
    } else {
      DMap.$(d._dom).hide();
      d._map.wait();
      d._dom.src = d.loadUrl(c);
    }
  },
  remove: function () {
    var a = this;
    if (a.unloadImg) {
      a.unloadImg();
    }
    DMap.Util.removeNode(this._dom);
    this._dom = null;
    this._map = null;
    this.idPrefix = null;
  },
  copy: function () {
    return new DMap.WMSLayer(this.urlTemplate);
  },
  loadUrl: function (c) {
    var b = this._map.getSize();
    var d = Math.round(c.left * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(c.bottom * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(c.right * DMap.PRECISION) / DMap.PRECISION + ',' + Math.round(c.top * DMap.PRECISION) / DMap.PRECISION;
    var a = DMap.Util.buildTemplateStr(this.urlTemplate, {
      WIDTH: b.w,
      HEIGHT: b.h,
      MINX: Math.round(c.left * DMap.PRECISION) / DMap.PRECISION,
      MAXX: Math.round(c.right * DMap.PRECISION) / DMap.PRECISION,
      MINY: Math.round(c.bottom * DMap.PRECISION) / DMap.PRECISION,
      MAXY: Math.round(c.top * DMap.PRECISION) / DMap.PRECISION,
      BOX: d
    });
    return a + '&imageversion=' + this.imageversion;
  },
  resetUrl: function (a) {
    if (a) {
      this.urlTemplate = a;
    }
    this.imageversion = new Date().getTime();
    this.redraw();
  },
  refresh: function () {
    this.resetUrl();
  },
  CLASS_NAME: 'DMap.WMSLayer'
});
DMap.Class('KMLLayer', DMap.Overlay, {
  _map: null,
  _dom: null,
  _url: null,
  _name: null,
  imageversion: null,
  _minNum: 0,
  _maxNum: 0,
  _markCuster: false,
  initialize: function (b, a, d, c, e) {
    DMap.EhlException.isTypeRight(b, 'undefined');
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException.isTypeRight(d, 'number');
    DMap.EhlException.isTypeRight(c, 'number');
    this._name = b;
    this._url = a;
    this._minNum = d;
    this._maxNum = c;
    this.imageversion = new Date().getTime();
    this.features = [];
    this._markCuster = e || this._markCuster;
  },
  getDoms: function () {
    return this._dom;
  },
  draw: function (c) {
    var b = this;
    b._map = c;
    var a = new DMap.KmlMetadata({
      callback: function (d) {
        b.features = d;
      }
    });
    a.read(this._url, c, b._minNum, b._maxNum, b._markCuster);
  },
  copy: function () {
    return new DMap.KMLLayer(this._name, this._url, this._minNum, this._maxNum, this._markCuster);
  },
  remove: function () {
    var b = this;
    if (b.unloadImg) {
      b.unloadImg();
    }
    DMap.Util.removeNode(this._dom);
    for (var a = 0; a < b.features.length; a++) {
      this._map.removeOverlay(b.features[a]);
    }
    this._dom = null;
    this._map = null;
    b.features = [];
  },
  CLASS_NAME: 'DMap.KMLLayer'
});
DMap.Class('FloatHelpOverlay', DMap.Overlay, {
  _dom: null,
  _disDom: null,
  _helpDom: null,
  _map: null,
  _isShow: null,
  initialize: function () {
    this._isShow = false;
  },
  draw: function (b) {
    var a = this;
    this._dom = document.createElement('div');
    document.getElementById(b._panelDrawId).appendChild(this._dom);
    DMap.$(this._dom).css({
      position: 'absolute',
      border: '1px solid #666666',
      display: 'none',
      left: '-10000px',
      top: '-10000px',
      backgroundColor: '#FFFFFF',
      fontSize: '14px',
      padding: '1px',
      whiteSpace: 'nowrap',
      zIndex: '1000'
    });
    this._disDom = document.createElement('div');
    this._dom.appendChild(this._disDom);
    this._disDom.style.color = '#000000';
    this._helpDom = document.createElement('div');
    this._dom.appendChild(this._helpDom);
    this._map = b;
    DMap.$(this._map).bind('mousemove.FloatHelpOverlay', function (f, d) {
      if (a._isShow) {
        var c = this.fromLonLatToDivPixel(d);
        a._dom.style.left = (c.x + 28) + 'px';
        a._dom.style.top = c.y + 'px';
      }
    });
  },
  redraw: function (a) {
  },
  remove: function () {
    DMap.$(this._map).unbind('.FloatHelpOverlay');
    DMap.Util.removeNode(this._disDom);
    DMap.Util.removeNode(this._helpDom);
    DMap.Util.removeNode(this._dom);
    this._disDom = null;
    this._helpDom = null;
    this._dom = null;
    this._map = null;
  },
  getDoms: function () {
    return this._dom;
  },
  show: function (b, a) {
    this._isShow = true;
    this._dom.style.display = 'block';
    this._helpDom.style.display = 'block';
    this._helpDom.innerHTML = b;
    if (a) {
      this._disDom.style.display = 'block';
      this._disDom.innerHTML = b;
    } else {
      this._disDom.style.display = 'none';
    }
  },
  hide: function () {
    this._isShow = false;
    this._dom.style.left = '10000px';
    this._dom.style.top = '10000px';
    this._dom.style.display = 'none';
    this._helpDom.style.display = 'none';
    this._disDom.style.display = 'none';
  }
});
DMap.Class('InfoWindow', DMap.Overlay, {
  _dom: null,
  _shadow: null,
  _map: null,
  _size: null,
  _lonlat: null,
  _offsetSize: null,
  initialize: function () {
    this._contentContainers = [];
    this.arrowWidth = 98;
    this.arrowHeight = 96;
    this._createDom();
  },
  reset: function (e, c, d, b, a) {
    if (a) {
      this.hook(a);
    }
    this._offsetSize = b || new DMap.Size(0, 0);
    this._setSize(d);
    this.setLonlat(e, c, this._offsetSize);
    this.show();
  },
  hook: function (a) {
    if (this.marker === a) {
      return;
    }
    if (this.marker != null) {
      delete this.marker.moveToLonLat;
    }
    if (a != null) {
      var c = a.moveToLonlat;
      var b = this;
      a.moveToLonlat = function () {
        c.apply(a, arguments);
        var d = a.getLonlat();
        b.reset(d, false, b._size, b._offsetSize);
      };
    }
    this.marker = a;
  },
  getLonLat: function () {
    return this._lonlat;
  },
  setLonlat: function (e, c, k) {
    if (e) {
      this._lonlat = e;
    }
    if (this._lonlat) {
      var b = this._map.fromLonLatToDivPixel(this._lonlat);
      var i = this._size.h + this.arrowHeight - 25;
      var d = b.x - Math.ceil((this._size.w - this.arrowWidth) / 2) - 4 + k.w;
      var h = b.y - i - k.h;
      DMap.$(this._dom).css({left: d - 5, top: h + 42});
      DMap.$(this._shadow).css({left: d - 5, top: h + 42});
      if (c) {
        var f = this._map.fromDivPixelToLonLat(new DMap.Pixel(d, (h + this._size.h + this.arrowHeight)));
        var a = this._map.fromDivPixelToLonLat(new DMap.Pixel((d + this._size.w), h));
        var j = new DMap.LonLatBounds(f.lon, f.lat, a.lon, a.lat);
        var g = this._map.getBounds();
        if (g.contains(this._lonlat)) {
          if (this._map.getBounds().containsBounds(j, false)) {
          } else {
            this._map.panTo(this._lonlat);
          }
        } else {
          this._map.panTo(this._lonlat);
        }
      }
    }
  },
  restore: function () {
  },
  getContentContainers: function () {
    return this._contentContainers;
  },
  getSize: function () {
    return this._size;
  },
  _setSize: function (c) {
    var e = this._map.getSize();
    if (c.w < 248) {
      c = new DMap.Size(248, c.h);
    }
    if (c.h < 97) {
      c = new DMap.Size(c.w, 97);
    }
    if (c.w < DMap.$(this._textDiv).width()) {
    }
    if (c.h < DMap.$(this._textDiv).height()) {
    }
    if (c) {
      if (this._size && this._size.equals(c)) {
        return;
      }
      this._size = c;
    } else {
      return;
    }
    var d = c.w;
    var a = c.h;
    DMap.$(this._containerDiv).css({width: d + 'px', height: a + 'px'});
    DMap.$(this._containerShadow).css({width: (d + 90) + 'px', top: '65px', height: (a - 40) + 'px'});
    DMap.$(this._closeImg).css({left: (d - 24) + 'px'});
    DMap.$(this._plusImg).css({left: (d - 24) + 'px'});
    DMap.$(this._minusImg).css({left: (d - 24) + 'px'});
    DMap.$(this._textDiv).css({width: (d - 32) + 'px', height: (a - 32) + 'px'});
    DMap.$(this._ltCorner).css({width: '25px', height: '25px', left: '0px', top: '0px'});
    DMap.$(this._rtCorner).css({width: '25px', height: '25px', left: (d - 25) + 'px', top: '0px'});
    DMap.$(this._arrow).css({
      width: 40 + 'px',
      height: (this.arrowHeight - 46) + 'px',
      left: Math.ceil((d - this.arrowWidth) / 2) + 'px',
      top: (a - 25) + 'px'
    });
    DMap.$(this._lbCorner).css({width: '25px', height: '25px', left: '0px', top: (a - 25) + 'px'});
    DMap.$(this._rbCorner).css({width: '25px', height: '25px', left: (d - 25) + 'px', top: (a - 25) + 'px'});
    if (DMap.$.boxModel) {
      DMap.$(this._topLine).css({width: (d - 50) + 'px'});
      DMap.$(this._lrLine).css({width: (d - 2) + 'px', height: (a - 50) + 'px'});
      DMap.$(this._bottomLine).css({width: (d - 50) + 'px', top: (a - 25) + 'px'});
    } else {
      DMap.$(this._topLine).css({width: (d - 50) + 'px'});
      DMap.$(this._lrLine).css({width: d + 'px', height: (a - 48) + 'px'});
      DMap.$(this._bottomLine).css({width: (d - 50) + 'px', top: (a - 24) + 'px'});
    }
    DMap.$(this._bottomShadow1).css({
      width: (d - 42) / 2 - 30 + 'px',
      bottom: '13px',
      height: (a / 2 + 20) + 'px',
      left: '21px'
    });
    DMap.$(this._bottomShadow2).css({
      width: (d - 42) / 2 - 30 + 'px',
      bottom: '13px',
      height: (a / 2 + 20) + 'px',
      left: Math.ceil((d - this.arrowWidth) / 2 + 79) + 'px'
    });
    DMap.$(this._arrowShadow).css({
      width: 60 + 'px',
      bottom: '-5px',
      height: 50 + 'px',
      left: Math.ceil((d - this.arrowWidth) / 2 + 19) + 'px'
    });
    DMap.$(this._leftShadow).css({bottom: '10px', width: 24 + 'px', left: '-3px', height: (a - 10) + 'px'});
    DMap.$(this._rightShadow).css({bottom: '10px', width: 21 + 'px', height: (a - 10) + 'px', left: (d - 21) + 'px'});
    DMap.$(this._topShadow).css({
      bottom: '10px',
      width: (a / 2 + 15) + 'px',
      height: a / 2 + 15 + 'px',
      left: d + 'px'
    });
    DMap.$(this._uptopShadow).css({
      bottom: (a / 2 + 25) + 'px',
      width: a / 2 + 'px',
      height: 10 + 'px',
      left: d + 'px'
    });
    DMap.$(this._cornerShadow).css({
      bottom: (a / 2 + 25) + 'px',
      width: 20 + 'px',
      height: 10 + 'px',
      left: (d + a / 2) + 'px'
    });
    if ((a / 2 + 25) > 150) {
      var b = {display: 'none'};
      DMap.$(this._uptopShadow).css(b);
      DMap.$(this._cornerShadow).css(b);
    }
  },
  _createMyimge: function (a, c) {
    var b = document.createElement('div');
    DMap.$(b).css({position: 'absolute', zIndex: 1, overflow: 'hidden'});
    var d = document.createElement('img');
    DMap.$(d).attr('src', gisapi.getImageUrl('iws.png')).css({
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      overflow: 'hidden',
      left: a + 'px',
      bottom: c + 'px',
      width: '1144px',
      height: '370px'
    });
    b.appendChild(d);
    if (DMap.$(d).pngFix) {
      DMap.$(d).pngFix();
    }
    return b;
  },
  _createDom: function () {
    var b = this;
    this._dom = document.createElement('div');
    DMap.$(this._dom).css('position', 'absolute');
    this._containerDiv = document.createElement('div');
    DMap.$(this._containerDiv).css({position: 'relative', left: '0px', top: '0px', zIndex: '10'});
    this._dom.appendChild(this._containerDiv);
    this._shadow = document.createElement('div');
    DMap.$(this._shadow).css('position', 'absolute');
    this._containerShadow = document.createElement('div');
    DMap.$(this._containerShadow).css({position: 'absolute', left: '0px', zIndex: '99'});
    this._shadow.appendChild(this._containerShadow);
    this._bottomShadow1 = this._createMyimge(-300, -38);
    this._containerShadow.appendChild(this._bottomShadow1);
    this._bottomShadow2 = this._createMyimge(-300, -38);
    this._containerShadow.appendChild(this._bottomShadow2);
    this._arrowShadow = this._createMyimge(-520, -20);
    this._containerShadow.appendChild(this._arrowShadow);
    this._leftShadow = this._createMyimge(-47, -35);
    this._containerShadow.appendChild(this._leftShadow);
    this._rightShadow = this._createMyimge(-763, -35);
    this._containerShadow.appendChild(this._rightShadow);
    this._topShadow = this._createMyimge(-970, -220);
    this._containerShadow.appendChild(this._topShadow);
    this._uptopShadow = this._createMyimge(-950, -355);
    this._containerShadow.appendChild(this._uptopShadow);
    this._cornerShadow = this._createMyimge(-1089, -355);
    this._containerShadow.appendChild(this._cornerShadow);
    this._closeImg = document.createElement('img');
    DMap.$(this._closeImg).attr('src', gisapi.getImageUrl('iw_close.gif')).css({
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      top: '11px',
      width: '12px',
      height: '12px',
      cursor: 'pointer',
      zIndex: '10000'
    }).bind('mousedown', function () {
      DMap.$(b._map).trigger('infowindowbeforeclose');
      b.hide();
      DMap.$(b._map).trigger('infowindowclose');
      return false;
    });
    this._containerDiv.appendChild(this._closeImg);
    this._plusImg = document.createElement('img');
    DMap.$(this._plusImg).attr('src', gisapi.getImageUrl('iw_plus.gif')).css({
      display: 'none',
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      top: '0px',
      width: '12px',
      height: '12px',
      cursor: 'pointer',
      zIndex: '10000'
    }).bind('mousedown', function () {
      return false;
    });
    this._containerDiv.appendChild(this._plusImg);
    this._minusImg = document.createElement('img');
    DMap.$(this._minusImg).attr('src', gisapi.getImageUrl('iw_minus.gif')).css({
      display: 'none',
      border: '0px none',
      margin: '0px',
      padding: '0px',
      position: 'absolute',
      top: '0px',
      width: '12px',
      height: '12px',
      cursor: 'pointer',
      zIndex: '10000'
    }).bind('mousedown', function () {
      return false;
    });
    this._containerDiv.appendChild(this._minusImg);
    this._textDiv = document.createElement('div');
    DMap.$(this._textDiv).css({position: 'absolute', left: '16px', top: '16px', zIndex: '10'});
    this._containerDiv.appendChild(this._textDiv);
    var a = document.createElement('div');
    this._textDiv.appendChild(a);
    this._contentContainers.push(a);
    this._ltCorner = this._createCorner(0, 0);
    this._dom.appendChild(this._ltCorner);
    this._rtCorner = this._createCorner(-665, 0);
    this._dom.appendChild(this._rtCorner);
    this._arrow = this._createCorner(-368, -690);
    this._dom.appendChild(this._arrow);
    this._lbCorner = this._createCorner(0, -665);
    this._dom.appendChild(this._lbCorner);
    this._rbCorner = this._createCorner(-665, -665);
    this._dom.appendChild(this._rbCorner);
    this._topLine = this._createLine(25, 0, 0, 25, 'borderTop');
    this._dom.appendChild(this._topLine);
    this._lrLine = this._createLine(0, 25, 0, 0, 'borderLeft', 'borderRight');
    this._dom.appendChild(this._lrLine);
    this._bottomLine = this._createLine(25, 0, 0, 24, 'borderBottom');
    this._dom.appendChild(this._bottomLine);
  },
  _createCorner: function (d, b) {
    var a = document.createElement('div');
    DMap.$(a).css({overflow: 'hidden', zIndex: '1', position: 'absolute'});
    if (needPngFix) {
      var c = document.createElement('div');
      DMap.$(c).css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop,src=\'' + gisapi.getImageUrl('iw2.png') + '\')').css({
        overflow: 'hidden',
        border: '0px none',
        margin: '0px',
        padding: '0px',
        position: 'absolute',
        left: d + 'px',
        top: b + 'px',
        width: '690px',
        height: '786px'
      });
      a.appendChild(c);
    } else {
      var c = document.createElement('img');
      DMap.$(c).attr('src', gisapi.getImageUrl('iw2.png')).css({
        border: '0px none',
        margin: '0px',
        padding: '0px',
        position: 'absolute',
        left: d + 'px',
        top: b + 'px',
        width: '690px',
        height: '786px'
      });
      a.appendChild(c);
    }
    return a;
  },
  _createLine: function (g, f, c, a, e, d) {
    var b = document.createElement('div');
    DMap.$(b).css({
      position: 'absolute',
      left: g + 'px',
      top: f + 'px',
      width: c + 'px',
      height: a + 'px',
      backgroundColor: 'white'
    }).css(e, '1px solid rgb(171, 171, 171)');
    if (d) {
      DMap.$(b).css(d, '1px solid rgb(171, 171, 171)');
    }
    return b;
  },
  draw: function (a) {
    this._map = a;
    this._setSize(new DMap.Size(248, 97));
    document.getElementById(a._panelInfowindowId).appendChild(this._dom);
    document.getElementById(a._panelShadowInfowindowId).appendChild(this._shadow);
  },
  redraw: function (a) {
    if (a) {
      this.setLonlat(this._lonlat, false, this._offsetSize);
    }
  },
  remove: function () {
    this.hook(null);
    DMap.Util.removeNode(this._shadow);
    DMap.Util.removeNode(this._dom);
    this._shadow = null;
    this._dom = null;
    this._map = null;
  },
  getDoms: function () {
    return [this._dom, this._shadow];
  }
});
DMap.Class('PictureOverlay', DMap.Overlay, {
  idPrefix: null, initialize: function (a, b) {
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException.isTypeRight(b, 'undefined');
    DMap.EhlException.isTypeRight(a, 'string');
    DMap.EhlException.isTypeRight(b, 'DMap.LonLatBounds');
    this._url = a;
    this._lonLatBounds = b;
  }, draw: function (c) {
    var b = this;
    this._map = c;
    if (needPngFix) {
      b._dom = document.createElement('div');
      DMap.$(b._dom).css({filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=\'' + this._url + '\')'}).show();
    } else {
      b._dom = document.createElement('img');
      this._dom.src = this._url;
    }
    this._dom.style.position = 'absolute';
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '108'
      });
      document.getElementById(b._map._panelContainerId).appendChild(a);
      a.appendChild(b._dom);
    }
    this._movePosition();
  }, getDoms: function () {
    return this._dom;
  }, _movePosition: function () {
    var b = map.fromLonLatToDivPixel(new DMap.LonLat(this._lonLatBounds.left, this._lonLatBounds.top));
    var c = parseInt((this._lonLatBounds.right - this._lonLatBounds.left) / this._map.resolutions[this._map.getZoom()]);
    var a = parseInt((this._lonLatBounds.top - this._lonLatBounds.bottom) / this._map.resolutions[this._map.getZoom()]);
    this._dom.style.left = b.x + 'px';
    this._dom.style.top = b.y + 'px';
    this._dom.style.width = c + 'px';
    this._dom.style.height = a + 'px';
  }, redraw: function (a) {
    if (a) {
      this._movePosition();
    }
  }, remove: function () {
    DMap.Util.removeNode(this._dom);
  }
});
DMap.Class('Map', DMap.MapBase, {
  initialize: function () {
    DMap.MapBase.initialize.apply(this, arguments);
    var d = this;
    var c = d.getSize();
    var b = function (g) {
      var j = -parseInt(document.getElementById(d._panelContainerId).style.left) - c.w;
      var i = -parseInt(document.getElementById(d._panelContainerId).style.top) - c.h;
      var h = 3 * c.w;
      var f = 3 * c.h;
      document.getElementById(g).style.left = j + 'px';
      document.getElementById(g).style.top = i + 'px';
      document.getElementById(g).setAttribute('width', h);
      document.getElementById(g).setAttribute('height', f);
      document.getElementById(g).setAttribute('viewBox', j + ' ' + i + ' ' + h + ' ' + f);
    };
    var e = function (j, f, h, g) {
      var i = (f == null) ? false : true;
      if (!DMap.$.browser.msie && i) {
        b(d._panelPolygonId);
        b(d._panelPolylineId);
      }
      this._currentMapType.redraw(i, f, h, g);
      DMap.$.each(j.target._overlayArray, function (n, m) {
        m.redraw(i);
        if (i) {
          var l = d.getZoom();
          var k = true;
          if (m._minZoom != null && l < m._minZoom) {
            k = false;
          }
          if (m._maxZoom != null && l > m._maxZoom) {
            k = false;
          }
          if (k) {
            if (m.isHidden()) {
              m.show(true);
            }
          } else {
            if (!m.isHidden()) {
              m.hide(true);
            }
          }
        }
      });
      d.curMapBound = d.getBounds();
    };
    if (!DMap.$.browser.msie) {
      b(d._panelPolygonId);
      b(d._panelPolylineId);
    }
    DMap.$(this).bind('move', function (h, f, g) {
      this._currentMapType.redraw(false, f, g);
    });
    DMap.$(this).bind('moveend', e);
    DMap.$(this).bind('zoomend', e);
    DMap.$(this).bind('leftPanelControlShow', function (h, f, g) {
      this.panDirection(g / 2, 0, true);
    });
    DMap.$(this).bind('leftPanelControlHide', function (h, f, g) {
      this.panDirection(-g / 2, 0, true);
    });
    DMap.$(window).bind('unload', function () {
      d.destory();
    });
    this.setTitle('');
    this._overlayArray = [];
    this._mapChangeListener = [];
    d.curMapBound = d.getBounds();
  }, addMapType: function (b) {
    this._mapTypeArray.push(b);
    DMap.$(this).trigger('addmaptype', [b]);
  }, setMapType: function (b) {
    if (b != this._currentMapType) {
      this._currentMapType.remove();
      this._currentMapType = b;
      b.draw(this);
      DMap.$(this).trigger('maptypechanged');
    }
  }, getMapTypeArray: function () {
    return this._mapTypeArray;
  }, removeMapType: function (b) {
    DMap.Util.removeItem(this._mapTypeArray, b);
    DMap.$(this).trigger('removemaptype', [b]);
  }, getCurrentMapType: function () {
    return this._currentMapType;
  }, clearMapTypes: function () {
    this.hideMapTypeControl();
    this._currentMapType.remove();
    this._mapTypeArray = [];
  }, addControl: function (b) {
    this._controlHash[b.CLASS_NAME] = b;
    b.draw(this);
  }, removeControl: function (b) {
    delete this._controlHash[b.CLASS_NAME];
    b.remove();
  }, getControl: function (b) {
    if (!this._controlHash[b]) {
      this.addControl(new DMap[b]);
    }
    return this._controlHash[b];
  }, getContainer: function () {
    return document.getElementById(this._containerId);
  }, clearControls: function () {
    var c;
    for (var b in this._controlHash) {
      c = this._controlHash[b];
      c.remove();
    }
    this._controlHash = {};
  }, addOverlay: function (b) {
    this._overlayArray.push(b);
    b.draw(this);
    DMap.$(this).trigger('addoverlay', [b]);
  }, removeOverlay: function (b) {
    DMap.Util.removeItem(this._overlayArray, b);
    b.remove();
    b = null;
    DMap.$(this).trigger('removeoverlay', [b]);
  }, clearOverlays: function () {
    var c = null;
    for (var d = 0, b = this._overlayArray.length; d < b; d++) {
      c = this._overlayArray[d];
      if (c && (c.CLASS_NAME != 'TileLayer' && c.CLASS_NAME != 'ThemeLayer')) {
        c.remove();
      }
      c = null;
    }
    this._overlayArray = [];
    this._infoWindowOverlay = null;
    DMap.$(this).trigger('clearoverlays');
  }, setCursor: function (b) {
    DMap.$get(this._viewportId).css('cursor', b);
  }, activateFalshIn: function (c) {
    DMap.$(this).trigger('falshIn_end');
    var b = this.fromLonLatToContainerPixel(c);
    this._zoomChangeControl.changeAnimate(b, 'in');
  }, activateFalshOut: function (c) {
    DMap.$(this).trigger('falshOut_end');
    var b = this.fromLonLatToContainerPixel(c);
    this._zoomChangeControl.changeAnimate(b, 'out');
  }, activateTool: function (f, b, e, d) {
    var c = this;
    b = b || function (h, g) {
      alert(g);
    };
    this._toolbarHelper.activate(f, d);
    this._toolbarHelper.bindCallback(function (h, g) {
      b.apply(e || window, [h, g]);
    });
  }, getXaMeature: function (d) {
    var e = 0;
    for (var f = 1; f < d.length; f++) {
      var c = d[f - 1].lon;
      var k = d[f - 1].lat;
      var b = d[f].lon;
      var h = d[f].lat;
      var j = Math.abs(c - b);
      var g = Math.abs(k - h);
      e += Math.sqrt(j * j + g * g);
    }
    return e;
  }, screenToMap: function (b) {
    var c = new DMap.Size(parseInt(b), parseInt(b));
    var e = this.getSize();
    var d = c.w / e.w * (parseInt(DMap.$('#' + this._viewportId).width()));
    d = Math.round(d * 100) / 100;
    return d;
  }, activateMeaturePolyline: function () {
    var b = this;
    this.activateTool('ARCTIVEMEASURE', function (h, g) {
      var d = null;
      var f;
      if (DCMapServer.GlobeParams.MapCoordinate == 3) {
        var c = b.getXaMeature(g);
        d = b.screenToMap(c);
      } else {
        d = DMap.Util.measureDistance(g);
      }
      f = d + gisapi.DMap_activateMeaturePolyline_text;
      if (d > 1000) {
        f = d / 1000 + gisapi.DMap_activateMeaturePolyline_text_km;
      }
      b.hideFloatHelper();
      alert(f);
      b.deactivate();
    }, window, gisapi.DMap_activateMeaturePolyline_tooltip);
  }, activateMeaturePolygon: function () {
    var b = this;
    this.activateTool('ARCTIVEAREA', function (f, d) {
      var c;
      if (DCMapServer.GlobeParams.MapCoordinate == 3) {
        c = b.activateCityCoordinateArea(d) + gisapi.DMap_activateMeatureArea_text;
        if (b.activateCityCoordinateArea(d) > 10000) {
          c = b.activateCityCoordinateArea(d) / 10000 + '\u5e73\u65b9\u516c\u91cc';
        }
        b.hideFloatHelper();
        alert(c);
        b.deactivate();
      } else {
        c = b.activateRealArea(d) + gisapi.DMap_activateMeatureArea_text;
        if (b.activateRealArea(d) > 10000) {
          c = b.activateRealArea(d) / 10000 + '\u5e73\u65b9\u516c\u91cc';
        }
        b.hideFloatHelper();
        alert(c);
        b.deactivate();
      }
    });
  }, activateCityCoordinateArea: function (d) {
    var c = this;
    if (d.length < 3) {
      return;
    }
    var f = new Array();
    var e = new Array();
    for (var b = 0; b < d.length; b++) {
      f[b] = d[b].lon;
      e[b] = d[b].lat;
    }
    return c.activateCaculateArea(f, e);
  }, activateCaculateArea: function (e, d) {
    var c = 0;
    if (e.length < 3) {
      return;
    }
    for (var b = 0; b < e.length - 1; b++) {
      c += parseFloat(e[b] * d[b + 1] - d[b] * e[b + 1]);
    }
    a = e.length - 1;
    poligonRealArea = parseFloat(c + e[a] * d[0] - d[a] * e[0]);
    if (c < 0) {
      c = -c;
    }
    return c / 2;
  }, activateRealArea: function (d) {
    var c = this;
    if (d.length < 3) {
      return;
    }
    var f = new Array();
    var e = new Array();
    for (var b = 0; b < d.length; b++) {
      f[b] = c.activeCalculateDistance(d[b].lon, d[b].lat, 0, d[b].lat);
      e[b] = c.activeCalculateDistance(d[b].lon, d[b].lat, d[b].lon, 0);
    }
    return c.activateCaculateArea(f, e);
  }, activeCalculateDistance: function (j, f, i, e) {
    if (DCMapServer.GlobeParams.MapProjection == 0) {
      var q = j * Math.PI / 180;
      var p = i * Math.PI / 180;
      var n = f * Math.PI / 180;
      var m = e * Math.PI / 180;
      var l = q - p;
      var o = n - m;
      l = l / DCMapServer.GlobeParams.MapCoordinateType;
      o = o / DCMapServer.GlobeParams.MapCoordinateType;
      var d = Math.pow(Math.sin(o / 2), 2) + Math.cos(n) * Math.cos(m) * Math.pow(Math.sin(l / 2), 2);
      var c = 2 * Math.asin(Math.min(1, Math.sqrt(d)));
      var b = (3963 - 13 * Math.sin((n + m) / 2)) * c;
      return b * 1609.344;
    } else {
      var h = new DMap.LonLat(j, f);
      var g = new DMap.LonLat(i, e);
      var k = DMap.Util.measureDistance([h, g]);
      return k;
    }
  }, activateLineDistance: function (d) {
    var c = this;
    if (d.length < 2) {
      return;
    }
    var f = new Array();
    var e = new Array();
    for (var b = 0; b < d.length; b++) {
      f[b] = c.activeCalculateDistance(d[b].lon, d[b].lat, 0, d[b].lat);
      e[b] = c.activeCalculateDistance(d[b].lon, d[b].lat, d[b].lon, 0);
    }
    return c.caculateLineDistance(f, e);
  }, caculateLineDistance: function (e, d) {
    if (e.length < 2) {
      return;
    }
    var c = Math.sqrt(Math.pow((e[0] - e[1]), 2) + Math.pow((d[0] - d[1]), 2));
    var b = 2 * Math.abs(d[0] - d[1]) * Math.asin(c / 2 / Math.abs(d[0] - d[1]));
    return b;
  }, measureDistance: function (e) {
    var i = e[0].lon;
    var h = e[1].lon;
    var g = e[0].lat;
    var f = e[1].lat;
    var o = i * Math.PI / 180;
    var n = h * Math.PI / 180;
    var l = g * Math.PI / 180;
    var k = f * Math.PI / 180;
    var j = o - n;
    var m = l - k;
    var d = Math.pow(Math.sin(m / 2), 2) + Math.cos(l) * Math.cos(k) * Math.pow(Math.sin(j / 2), 2);
    var c = 2 * Math.asin(Math.min(1, Math.sqrt(d)));
    var b = (3963 - 13 * Math.sin((l + k) / 2)) * c;
    return b * 1609.344;
  }, activateRecZoomIn: function () {
    var b = this;
    this.activateTool('ZOOMIN', function (g, k) {
      if (k.length > 2) {
        var m = b.getBounds();
        var l = new DMap.LonLatBounds(k[0].lon, k[2].lat, k[2].lon, k[0].lat);
        var c = Math.min(Math.abs((l.right - l.left) / (m.right - m.left)), Math.abs((l.bottom - l.top) / (m.bottom - m.top))) || 1;
        var h = b.resolutions[b.getZoom()] * c;
        var n = b.resolutions.length - 1;
        for (var f = 0, d = b.resolutions.length; f < d; f++) {
          if (h < b.resolutions[f] && h > b.resolutions[f + 1]) {
            n = f;
            break;
          }
        }
        if (n == b.getZoom()) {
          n++;
        }
        if (n >= b.resolutions.length) {
          n = b.resolutions.length - 1;
        }
        b.setCenter(l.midLonLat(), n, null);
      } else {
        b.setZoomByLonlat(k[0], b.getZoom() + 1, true);
      }
      b.deactivate();
      DMap.$(b).trigger('recZoomIn_end');
      DMap.$(b).trigger('zoomIn_end');
    }, window, gisapi.DMap_activateRecZoomIn_tooltip);
  }, activateRecZoomOut: function () {
    var b = this;
    this.activateTool('ZOOMOUT', function (g, k) {
      if (k.length > 2) {
        var m = b.getBounds();
        var l = new DMap.LonLatBounds(k[0].lon, k[2].lat, k[2].lon, k[0].lat);
        var c = Math.min(Math.abs((l.right - l.left) / (m.right - m.left)), Math.abs((l.bottom - l.top) / (m.bottom - m.top))) || 1;
        var h = b.resolutions[b.getZoom()] / c;
        var n = 0;
        for (var f = 0, d = b.resolutions.length; f < d; f++) {
          if (h < b.resolutions[f] && h > b.resolutions[f + 1]) {
            n = f;
            break;
          }
        }
        if (n == b.getZoom()) {
          n--;
        }
        if (n < 0) {
          n = 0;
        }
        b.setCenter(l.midLonLat(), n, null);
      } else {
        b.setZoomByLonlat(k[0], b.getZoom() - 1, true);
      }
      DMap.$(b).trigger('recZoomOut_end');
      DMap.$(b).trigger('zoomOut_end');
      b.deactivate();
    }, window, gisapi.DMap_activateRecZoomOut_tooltip);
  }, deactivate: function () {
    this._toolbarHelper.deactivate();
  }, showFloatHelper: function (b) {
    if (!this._floatHelpOverlay) {
      this._floatHelpOverlay = new DMap.FloatHelpOverlay();
      this._floatHelpOverlay.draw(this);
    }
    this._floatHelpOverlay.show(b);
  }, hideFloatHelper: function () {
    if (this._floatHelpOverlay) {
      this._floatHelpOverlay.hide();
    }
  }, getInfoWindow: function () {
    if (!this._infoWindowOverlay) {
      this._infoWindowOverlay = new DMap.InfoWindow();
      this.addOverlay(this._infoWindowOverlay);
      this._infoWindowOverlay.hide();
    }
    return this._infoWindowOverlay;
  }, _setInfoWindow: function (d, c) {
    c = DMap.$.extend({size: new DMap.Size(248, 97), isAdjustPositon: true, offsetSize: new DMap.Size(0, 0)}, c);
    var b = this.getInfoWindow();
    b.reset(d, c.isAdjustPositon, c.size, c.offsetSize, c.marker);
    return b;
  }, openInfoWindowHtml: function (g, h, d) {
    var i = document.getElementById(this._containerId);
    var b = document.createElement('span');
    b.innerHTML = h;
    i.appendChild(b);
    DMap.$(b).css({overflow: 'auto', border: 'solid red 1px'});
    var c = b.offsetWidth;
    var j = b.offsetHeight;
    i.removeChild(b);
    if (!d || (!d.size)) {
      d = {size: new DMap.Size(c + 40, j + 30)};
    }
    var f = this._setInfoWindow(g, d);
    var e = this.getInfoWindow().getContentContainers()[0];
    e.innerHTML = '';
    DMap.$(e).empty();
    e.innerHTML = h;
    DMap.$(this).trigger('infowindowopen');
    return f;
  }, openInfoWindow: function (d, c, b) {
    this._setInfoWindow(d, b);
    var e = this.getInfoWindow().getContentContainers()[0];
    e.innerHTML = '';
    DMap.$(e).empty();
    e.appendChild(c);
    DMap.$(this).trigger('infowindowopen');
  }, closeInfoWindow: function () {
    if (this._infoWindowOverlay) {
      DMap.$(this).trigger('infowindowbeforeclose');
      this._infoWindowOverlay.hide();
      DMap.$(this).trigger('infowindowclose');
    }
  }, getPlanInfoWindow: function (c, b) {
    c = c || 310;
    b = b || 245;
    if (!this._planInfoWindowOverlay) {
      this._planInfoWindowOverlay = new DMap.PlanInfoWindow({map: this, planWidth: c, planHeight: b});
      this.addOverlay(this._planInfoWindowOverlay);
      this._planInfoWindowOverlay.hide();
    } else {
      this._planInfoWindowOverlay._setSize(new DMap.Size(c, b));
    }
    return this._planInfoWindowOverlay;
  }, closePlanInfoWindow: function () {
    if (this._planInfoWindowOverlay) {
      this._planInfoWindowOverlay.hide();
    }
  }, getSize: function () {
    return new DMap.Size(DMap.$get(this._viewportId).width(), DMap.$get(this._containerId).height());
  }, getZoomNums: function () {
    return this.resolutions.length;
  }, getZoom: function () {
    return this._zoom;
  }, getBounds: function () {
    var f = this.getSize();
    var d = new DMap.Pixel(this.padding.left, f.h - this.padding.bottom);
    var b = new DMap.Pixel(f.w - this.padding.right, this.padding.top);
    var c = this.fromContainerPixelToLonLat(d);
    var e = this.fromContainerPixelToLonLat(b);
    return new DMap.LonLatBounds(c.lon, c.lat, e.lon, e.lat);
  }, getExtent: function () {
    return this.getCurrentMapType().maxBounds;
  }, getCenter: function () {
    var c = this.getSize();
    var b = new DMap.Pixel(c.w / 2, c.h / 2);
    return this.fromContainerPixelToLonLat(b);
  }, getContainerPosition: function () {
    return DMap.$get(this._containerId).position();
  }, refreshMap: function () {
    this.getCurrentMapType().refresh();
  }, panTo: function (b) {
    var d = this;
    if (this.getBounds().contains(b)) {
      var c = this.fromLonLatToDivPixel(b);
      var e = this.fromLonLatToDivPixel(this.getCenter());
      this.panDirection(e.x - c.x, e.y - c.y);
    } else {
      this.setCenter(b);
    }
  }, zoomIn: function () {
    this.setZoom(this.getZoom() + 1, true);
    DMap.$(this).trigger('zoomIn_end');
  }, zoomOut: function () {
    this.setZoom(this.getZoom() - 1, true);
    DMap.$(this).trigger('zoomOut_end');
  }, setZoomByLonlat: function (f, d, b) {
    if (d < 0 || d < DCMapServer.GlobeParams.MapMinLevel || d >= this.resolutions.length) {
      return;
    }
    var c = this.fromLonLatToContainerPixel(f);
    var e = this.getZoom();
    var g = DMap.$('#' + this._panelContainerId).position();
    this.projection.setControlPoint(f, new DMap.Pixel(0, 0));
    document.getElementById(this._panelContainerId).style.left = c.x + 'px';
    document.getElementById(this._panelContainerId).style.top = c.y + 'px';
    this._currentMapType.redraw(true, e, e);
    this._zoom = d;
    DMap.$(this).trigger('zoomend', [e, d, b]);
  }, setZoom: function (c, b) {
    this.setZoomByLonlat(this.getCenter(), c, b);
  }, getfullExtent: function () {
    var c = new String(DCMapServer.GlobeParams.MapFullExtent).split(',');
    var b = new DMap.LonLatBounds(new Number(c[0]), new Number(c[1]), new Number(c[2]), new Number(c[3]));
    return b;
  }, fullExtent: function () {
    var c = new String(DCMapServer.GlobeParams.MapFullExtent).split(',');
    var b = new DMap.LonLatBounds(new Number(c[0]), new Number(c[1]), new Number(c[2]), new Number(c[3]));
    this.zoomToLonlatBounds(b, true);
  }, centerAtMBR: function (c, b, f, e) {
    var d = new DMap.LonLatBounds(c, b, f, e);
    this.zoomToLonlatBounds(d, true);
  }, centerAtLatLng: function (h) {
    var c = h.split(',');
    var k, j, e, d;
    for (var b = 0; b < c.length - 1; b += 2) {
      var f = parseFloat(c[b]);
      var g = parseFloat(c[b + 1]);
      if (b == 0) {
        k = f;
        j = g;
        e = f;
        d = g;
      } else {
        if (k > f) {
          k = f;
        }
        if (e < f) {
          e = f;
        }
        if (j > g) {
          j = g;
        }
        if (d < g) {
          d = g;
        }
      }
    }
    this.centerAtMBR(k, j, e, d);
  }, zoomToLonlatBounds: function (c, b, f) {
    var l = this.getSize();
    var h = c.w() / l.w;
    var g = c.h() / l.h;
    h = (h > g) ? h : g;
    var k = 2;
    if (h >= this.resolutions[0]) {
      k = 0;
    } else {
      if (h <= this.resolutions[this.resolutions.length - 1]) {
        k = this.resolutions.length - 1;
      } else {
        for (var e = 0, d = this.resolutions.length; e < d; e++) {
          if (h < this.resolutions[e] && h > this.resolutions[e + 1]) {
            k = e;
            break;
          }
        }
      }
    }
    if (f) {
      k = f;
    }
    this.setCenter(c.midLonLat(), k, true);
    if (this.getZoom() > k) {
      DMap.$(this).trigger('zoomOut_end');
    } else {
      if (this.getZoom() < k) {
        DMap.$(this).trigger('zoomIn_end');
      }
    }
  }, panDirection: function (d, c, b, h) {
    var e = this;
    if (b) {
      var i = document.getElementById(e._panelContainerId);
      var g = parseInt(i.style.left);
      var f = parseInt(i.style.top);
      i.style.left = (g + d) + 'px';
      i.style.top = (f + c) + 'px';
      DMap.$(e).trigger('moveend');
    } else {
      DMap.$(e).trigger('movestart');
      DMap.$get(e._panelContainerId).animate({left: '+=' + d, top: '+=' + c}, {
        duration: h == null ? 800 : h,
        easing: 'swing',
        complete: function () {
          DMap.$(e).trigger('moveend');
        },
        step: function () {
          DMap.$(e).trigger('move');
        },
        queue: false
      });
    }
  }, setCenter: function (c, j, i) {
    if (i == undefined) {
      i = true;
    }
    var h = this;
    var k = h.getSize();

    function e(l) {
      document.getElementById(h._panelContainerId).style.left = '0px';
      document.getElementById(h._panelContainerId).style.top = '0px';
      var n = parseInt(document.getElementById(h._panelContainerId).style.left);
      var m = parseInt(document.getElementById(h._panelContainerId).style.top);
      h.projection.setControlPoint(l, (new DMap.Pixel(k.w / 2, k.h / 2)).add(-n, -m));
    }

    if (!this._isLoaded) {
      if (DCMapServer.GlobeParams.MapInitCenter) {
        c = new DMap.LonLat(DCMapServer.GlobeParams.MapInitCenter[0], DCMapServer.GlobeParams.MapInitCenter[1]);
      }
      e(c || this._currentMapType.maxBounds.midLonLat());
      this._isLoaded = true;
      if (j < 0 || j >= this.resolutions.length) {
        this._zoom = 0;
      } else {
        var b = 0;
        if (DCMapServer.GlobeParams.MapInitLevel) {
          if (DCMapServer.GlobeParams.MapInitLevel < DCMapServer.GlobeParams.MapMinLevel) {
            b = DCMapServer.GlobeParams.MapMinLevel;
          } else {
            b = DCMapServer.GlobeParams.MapInitLevel;
          }
        }
        this._zoom = j || b;
      }
      this.setCursor('url(' + gisapi.getImageUrl('openhand.cur') + '), default');
      h._toolbarHelper = new DMap.ToolBarHelper();
      h.addControl(h._toolbarHelper);
      h._zoomChangeControl = new DMap.ZoomChangeControl();
      h.addControl(h._zoomChangeControl);
      this._currentMapType.draw(this);
    } else {
      if (j == null || j < 0 || j >= this.resolutions.length) {
        j = this.getZoom();
      }
      if (j < DCMapServer.GlobeParams.MapMinLevel) {
        j = DCMapServer.GlobeParams.MapMinLevel;
      }
      if (j != this.getZoom()) {
        e(c || this.getCenter());
        var g = this._zoom;
        this._zoom = j;
        if (i) {
          DMap.$(this).trigger('zoomend', [g, j]);
        }
      } else {
        if (c && !c.equals(this.getCenter())) {
          var f = this.fromLonLatToDivPixel(c);
          var d = this.fromLonLatToDivPixel(this.getCenter());
          this._dragObject.moveBy(d.x - f.x, d.y - f.y);
          if (i) {
            DMap.$(h).trigger('moveend');
          }
        }
      }
    }
  }, autoPan: function (l, j, i) {
    var e = this;
    var k = this.getSize();
    DMap.$get(e._panelContainerId).stop();
    var b = {};
    var h = 8;
    var f = h * (k.h / k.w);
    if (l == 0) {
      if (j == 0) {
        return;
      } else {
        b.top = (j > 0) ? '+=' + f : '-=' + f;
      }
    } else {
      if (j == 0) {
        b.left = (l > 0) ? '+=' + h : '-=' + h;
      } else {
        b.left = (l > 0) ? '+=' + h : '-=' + h;
        b.top = (j > 0) ? '+=' + f : '-=' + f;
      }
    }
    var g = 0;
    var d = 0;
    var c = function () {
      if (g > k.w / 3 || d > k.h / 3) {
        DMap.$(e).trigger('moveend');
        g = 0;
        d = 0;
      }
      DMap.$get(e._panelContainerId).animate(b, {
        duration: 50, easing: 'swing', complete: function () {
          g += h;
          d += f;
          c();
        }, step: function () {
          DMap.$(e).trigger('move');
        }, queue: true
      });
    };
    DMap.$(e).trigger('movestart');
    e._isAnimateing = true;
    c();
  }, stopAutoPan: function () {
    DMap.$get(this._panelContainerId).stop();
    if (this._isAnimateing) {
      DMap.$(this).trigger('moveend');
    }
    this._isAnimateing = false;
  }, printJT: function () {
    var b = this;
    b.activateTool('REC', function (i, k) {
      if (k.length > 2) {
        var p = b.fromLonLatToContainerPixel(k[0]);
        var o = b.fromLonLatToContainerPixel(k[2]);
        var n = b.fromLonLatToContainerPixel(k[1]);
        var l = b.fromLonLatToContainerPixel(k[3]);
        b.deactivate();
        var j = k[0].lon + ',' + k[2].lat + ',' + k[2].lon + ',' + k[0].lat;
        var f = b._currentMapType.getUrl() + '&Service=getRectImg&tiles=false&BBOX={BBOX}&zoom={ZOOM}';
        f = DMap.Util.buildTemplateStr(f, {ZOOM: b.getZoom(), BBOX: j});
        var g = Math.abs(o.y - p.y);
        var m = Math.abs(o.x - p.x);
        var q, c;
        var q, c;
        if (((o.x - p.x) > 0) && ((o.y - p.y) > 0)) {
          q = (-p.x);
          c = (-p.y);
        } else {
          if (((o.x - p.x) < 0) && ((o.y - p.y) < 0)) {
            q = (-o.x);
            c = (-o.y);
          } else {
            if (((o.x - p.x) > 0) && ((o.y - p.y) < 0)) {
              q = (-l.x);
              c = (-l.y);
            } else {
              q = (-n.x);
              c = (-n.y);
            }
          }
        }
        var d = 'print.jsp?url=' + encodeURIComponent(f);
        window.open(d, '_blank', 'width=' + m + ', height=' + g + '');
      }
    }, gisapi.printMessage);
  }, print: function () {
    var b = this;
    b.activateTool('REC', function (l, m) {
      if (m.length > 2) {
        var s = b.fromLonLatToContainerPixel(m[0]);
        var q = b.fromLonLatToContainerPixel(m[2]);
        var o = b.fromLonLatToContainerPixel(m[1]);
        var n = b.fromLonLatToContainerPixel(m[3]);
        b.deactivate();
        var g = Math.abs(q.y - s.y);
        var p = Math.abs(q.x - s.x);
        var u, c;
        var u, c;
        if (((q.x - s.x) > 0) && ((q.y - s.y) > 0)) {
          u = (-s.x);
          c = (-s.y);
        } else {
          if (((q.x - s.x) < 0) && ((q.y - s.y) < 0)) {
            u = (-q.x);
            c = (-q.y);
          } else {
            if (((q.x - s.x) > 0) && ((q.y - s.y) < 0)) {
              u = (-n.x);
              c = (-n.y);
            } else {
              u = (-o.x);
              c = (-o.y);
            }
          }
        }
        var j = window.open('about:blank', '_blank', 'width=' + p + ', height=' + g + '');
        var r = j.document;
        r.open();
        r.write('<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"><head></head><body><object style={display:none} classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="wb" name="wb" width=0" VIEWASTEXT></object><div style="overflow:hidden;position:absolute;left:0;top:0;width:' + p + 'px;height:' + g + 'px;"><div style="position:absolute;left:' + u + 'px;top:' + c + 'px">' + DMap.$('#' + b._viewportId).get(0).innerHTML + '</div></div></body><!--<script>try{wb.ExecWB(7,2);window.onfocus=function(){wb.ExecWB(45,1);};}catch(ex){window.close();}<\/script>--></html>');
        DMap.$(r).find('.map-zoombar').css({display: 'none'});
        r.close();
        if (r.createStyleSheet) {
          var t = r.createStyleSheet();
          try {
            r.namespaces.add('v', 'urn:schemas-microsoft-com:vml');
          } catch (l) {
          }
          var d = ['shape', 'rect', 'oval', 'fill', 'stroke', 'imagedata', 'group'];
          for (var f = 0, k = d.length; f < k; f++) {
            t.addRule('v\\:' + d[f], 'behavior: url(#default#VML); position: absolute; display: inline-block;');
          }
        }
        j.print();
      }
    }, gisapi.printMessage);
  }, setTitle: function (c) {
    if (!this._title) {
      var d = document.createElement('div');
      d.style.position = 'absolute';
      d.style.width = '100%';
      var b = document.createElement('div');
      b.className = 'map-title';
      DMap.$(this).bind('leftPanelControlShow.title', function (g, f) {
        b.style.marginLeft = f;
      });
      DMap.$(this).bind('leftPanelControlHide.title', function (g, f) {
        b.style.marginLeft = f;
      });
      d.appendChild(b);
      this._title = b;
      DMap.$('#' + this._viewportId).append(d);
    }
    this._title.innerHTML = c;
  }, wait: function () {
    if (!this._waiting) {
      var c = DMap.$('#' + this._containerId);
      if (!this._mask) {
        this._mask_dom = DMap.$('<div id="map-mask"/>').css('display', 'none').css('opacity', 0.5);
        this._waiting_dom = DMap.$('<div id="map-waiting"><div id="map-waiting-inner">' + gisapi.waitMessage + '<div></div>').css('display', 'none').attr('unselectable', 'on');
      }
      c.append(this._mask_dom);
      c.append(this._waiting_dom);
      this._mask_dom.css('display', 'block');
      this._waiting_dom.css('display', 'block');
      var f = this._waiting_dom.height();
      var g = this._waiting_dom.outerHeight();
      var d = (f + (g - f)) / 2;
      this._waiting_dom.css('margin-top', '-' + d + 'px');
      this._waiting_dom.css('top', '50%');
      var b = this._waiting_dom.width();
      var e = this._waiting_dom.outerWidth();
      var i = (b + (e - b)) / 2;
      this._waiting_dom.css('margin-left', '-' + i + 'px');
      this._waiting_dom.css('left', '50%');
      this._mask = true;
      this._waiting = true;
    }
  }, resume: function () {
    if (this._waiting) {
      this._mask_dom.css('display', 'none');
      this._waiting_dom.css('display', 'none');
      this._waiting = false;
    }
  }, clear: function () {
    DMap.$(this).trigger('clear');
  }, fromLonLatToDivPixel: function (b) {
    return this.projection.fromLonLatToDivPixel(b, this._zoom);
  }, fromDivPixelToLonLat: function (b) {
    return this.projection.fromDivPixelToLonLat(b, this._zoom);
  }, fromContainerPixelToLonLat: function (b) {
    b = b.add(-parseInt(document.getElementById(this._panelContainerId).style.left), -parseInt(document.getElementById(this._panelContainerId).style.top));
    return this.fromDivPixelToLonLat(b);
  }, fromContainerPixelToDivPixel: function (b) {
    var e = document.getElementById(this._panelContainerId);
    var d = parseInt(e.style.left);
    var c = parseInt(e.style.top);
    return b.add(-d, -c);
  }, fromLonLatToContainerPixel: function (c) {
    var b = this.fromLonLatToDivPixel(c);
    return b.add(parseInt(document.getElementById(this._panelContainerId).style.left), parseInt(document.getElementById(this._panelContainerId).style.top));
  }, fromMouseEventToLonLat: function (c) {
    var b = new DMap.Pixel(c.originalEvent.clientX, c.originalEvent.clientY);
    var d = DMap.$('#' + this._viewportId).get(0).getBoundingClientRect();
    return this.fromContainerPixelToLonLat(b.add(-d.left, -d.top));
  }, showCopyright: function () {
    var c = this._CopyrightControl;
    if (typeof c == 'undefined' || c == null) {
      this._CopyrightControl = new DMap.CopyrightControl();
      this.addControl(this._CopyrightControl);
      return;
    }
    c.show();
  }, hideCopyright: function () {
    var c = this._CopyrightControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.hide();
  }, showOverviewMap: function () {
    var c = this._OverviewMapControl;
    if (typeof c == 'undefined' || c == null) {
      this._OverviewMapControl = new DMap.OverviewMapControl();
      this.addControl(this._OverviewMapControl);
      return;
    }
    c.show();
  }, hideOverviewMap: function () {
    var c = this._OverviewMapControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.hide();
  }, openOverviewMap: function () {
    var c = this._OverviewMapControl;
    if (typeof c == 'undefined' || c == null) {
      this._OverviewMapControl = new DMap.OverviewMapControl();
      this.addControl(this._OverviewMapControl);
      c = this._OverviewMapControl;
    }
    c.open();
  }, closeOverviewMap: function () {
    var c = this._OverviewMapControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.close();
  }, showScaleControl: function () {
    var c = this._ScaleControl;
    if (typeof c == 'undefined' || c == null) {
      this._ScaleControl = new DMap.ScaleControl();
      this.addControl(this._ScaleControl);
      return;
    }
    c.show();
  }, hideScaleControl: function () {
    var c = this._ScaleControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.hide();
  }, showMapTypeControl: function () {
    var c = this._MapTypeControl;
    if (c) {
      c.show();
    }
    if (typeof c == 'undefined' || c == null) {
      this._MapTypeControl = new DMap.MapTypeControl();
      this.addControl(this._MapTypeControl);
      if (DMap_browser == 10) {
        DMap.$(this._MapTypeControl._dom).css({top: '25px'});
      } else {
        if (DMap.$.browser.version > 10 || DMap_browser == 1) {
          DMap.$(this._MapTypeControl._dom).css({top: '30px'});
        }
      }
      if (this._mapTypeArray.length < 2) {
        DMap.$(this._MapTypeControl._dom).hide();
      }
    }
  }, hideMapTypeControl: function () {
    var c = this._MapTypeControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.hide();
  }, showZoomBarControl: function () {
    var c = this._ZoomBarControl;
    if (typeof c == 'undefined' || c == null) {
      this._ZoomBarControl = new DMap.ZoomBarControl();
      this.addControl(this._ZoomBarControl);
      if (DMap_browser) {
        DMap.$(this._ZoomBarControl.dom).css({top: '25px'});
      }
      return;
    }
    c.show();
  }, hideZoomBarControl: function () {
    var c = this._ZoomBarControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.hide();
  }, showZoomBarControlGoogle: function () {
    var c = this._ZoomBarControlGoogle;
    if (typeof c == 'undefined' || c == null) {
      this._ZoomBarControlGoogle = new DMap.ZoomBarControlGoogle();
      this.addControl(this._ZoomBarControlGoogle);
      return;
    }
    c.show();
  }, hideZoomBarControlGoogle: function () {
    var c = this._ZoomBarControlGoogle;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    c.hide();
  }, showMousePositionControl: function () {
    var c = this._MousePositionControl;
    if (typeof c == 'undefined' || c == null) {
      this._MousePositionControl = new DMap.MousePositionControl();
      this.addControl(this._MousePositionControl);
      return;
    }
    DMap.$(c._dom).css({display: ''});
  }, hideMousePositionControl: function () {
    var c = this._MousePositionControl;
    if (typeof c == 'undefined' || c == null) {
      return;
    }
    DMap.$(c._dom).css({display: 'none'});
  }, triggerMapChangeListener: function () {
    for (var b = 0; b < this._mapChangeListener.length; b++) {
      try {
        this._mapChangeListener[b]();
      } catch (c) {
      }
    }
  }, addMapChangeListener: function (b) {
    DMap.$(this).bind('move.mapChangeListener', function () {
      try {
        b();
      } catch (c) {
        c = null;
      }
    });
    DMap.$(this).bind('zoomend.mapChangeListener', function () {
      try {
        b();
      } catch (c) {
        c = null;
      }
    });
  }
});

function Vector2D(b, a) {
  this.p1 = b;
  this.p2 = a;
}

Vector2D.prototype.reverse = function () {
  return new Vector2D(this.p2, this.p1);
};
Vector2D.prototype.getSpanX = function () {
  return this.p2.x - this.p1.x;
};
Vector2D.prototype.getSpanY = function () {
  return this.p2.y - this.p1.y;
};
Vector2D.prototype.getMod = function () {
  var a = this.getSpanX();
  var b = this.getSpanY();
  return Math.sqrt(a * a + b * b);
};
Vector2D.prototype.getSpan = function () {
  return {x: this.getSpanX(), y: this.getSpanY()};
};
Vector2D.prototype.getAngle = function () {
  var a = this.getSpanX();
  var b = this.getSpanY();
  return Math.atan2(b, a);
};
Vector2D.prototype.getPoint = function (b) {
  if (!b) {
    return {x: this.p1.x, y: this.p1.y};
  }
  var c = this.getAngle() + (arguments[1] || 0);
  var a = this.p1.x + b * Math.cos(c);
  var d = this.p1.y + b * Math.sin(c);
  return {x: a, y: d};
};
DMap.EhlException = {
  _isNull: function (a) {
    if (a === null) {
      alert(gisapi.isNullError);
      return;
    }
  }, _isArray: function (a) {
    if (Object.prototype.toString.call(a) === '[object Array]') {
      return true;
    } else {
      alert(gisapi.isCommonError + 'object Array!');
      return;
    }
  }, createError: function (a, b) {
    if (b) {
      alert(a + '\r\n' + gisapi.contenError + b.message);
      return new Error(a + '\r\n' + gisapi.contenError + b.message);
    } else {
      alert(a);
      return new Error(a);
    }
  }, isTypeRight: function (param1, type) {
    switch (type) {
      case'string':
        if (typeof param1 == 'string') {
          return true;
        } else {
          alert(gisapi.isStringError);
          return false;
        }
      case'int':
        if (typeof param1 == 'number') {
          if (param1.toString().indexOf('.') == -1) {
            return true;
          } else {
            alert(gisapi.isCommonError + 'int!');
            return false;
          }
        } else {
          alert(gisapi.isCommonError + 'int!');
          return false;
        }
      case'float':
        if (typeof param1 == 'number') {
          return true;
        } else {
          alert(gisapi.isCommonError + 'float!');
          return false;
        }
      case'number':
        if (typeof param1 == 'number') {
          return true;
        } else {
          alert(gisapi.isNumberError);
          return false;
        }
      case'boolean':
        if (typeof param1 == 'boolean') {
          return true;
        } else {
          alert(gisapi.isBooleanError);
          return false;
        }
      case'function':
        if (typeof param1 == 'function') {
          return true;
        } else {
          alert(gisapi.isFunctionError);
          return false;
        }
      case'object':
        if (typeof param1 == 'object') {
          return true;
        } else {
          alert(gisapi.isObjectError);
          return false;
        }
      case'undefined':
        if (typeof param1 == 'undefined') {
          alert(gisapi.isUndefinedError);
          return tru;
        } else {
          return false;
        }
      default:
        if (param1 instanceof eval(type)) {
          return true;
        } else {
          alert(gisapi.isCommonError + type);
          return false;
        }
    }
  }
};
DMap.Class('CurveLine', DMap.Polyline, {
  _lonlats: null, initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    var d = this.getCurvePoints(c);
    arguments[0] = d;
    DMap.Polyline.prototype.initialize.apply(this, arguments);
  }, getCurvePoints: function (b) {
    var d = [];
    for (var a = 0; a < b.length - 1; a++) {
      var c = this.getCurveByTwoPoints(b[a], b[a + 1]);
      if (c && c.length > 0) {
        d = d.concat(c);
      }
    }
    return d;
  }, getCurveByTwoPoints: function (v, r) {
    if (!v || !r || !(v instanceof DMap.LonLat) || !(r instanceof DMap.LonLat)) {
      return null;
    }
    var k = function (h) {
      return 1 - 2 * h + h * h;
    };
    var g = function (h) {
      return 2 * h - 2 * h * h;
    };
    var f = function (h) {
      return h * h;
    };
    curveCoordinates = [];
    var d = 30;
    var s = false;
    var n, u, e, a, w, p, l;
    var o = [];
    var q = 0;
    var m = 0;
    if (typeof(r) == 'undefined') {
      if (typeof(curveCoordinates) != 'undefined') {
        curveCoordinates = [];
      }
      return;
    }
    var c = parseFloat(v.lat);
    var b = parseFloat(r.lat);
    var y = parseFloat(v.lon);
    var x = parseFloat(r.lon);
    if (x > y) {
      if (parseFloat(x - y) > 180) {
        if (y < 0) {
          y = parseFloat(180 + 180 + y);
        }
      }
    }
    if (y > x) {
      if (parseFloat(y - x) > 180) {
        if (x < 0) {
          x = parseFloat(180 + 180 + x);
        }
      }
    }
    p = 0;
    l = 0;
    if (b == c) {
      n = 0;
      u = y - x;
    } else {
      if (x == y) {
        n = Math.PI / 2;
        u = c - b;
      } else {
        n = Math.atan((b - c) / (x - y));
        u = (b - c) / Math.sin(n);
      }
    }
    if (l == 0) {
      l = (n + (Math.PI / 5));
    }
    e = u / 2;
    w = e * Math.cos(l) + y;
    a = e * Math.sin(l) + c;
    for (q = 0; q < d + 1; q++) {
      curveCoordinates.push(new DMap.LonLat((y * k(m) + w * g(m)) + x * f(m), (c * k(m) + a * g(m) + b * f(m))));
      m = m + (1 / d);
    }
    return curveCoordinates;
  }, enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      var h = e.getCurvePoints(e._lonlats);
      e.setLonlats(h);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, copy: function () {
    return new DMap.CurveLine(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }, CLASS_NAME: 'DMap.CurveLine'
});
DMap.CurveLine.clone = function (a) {
  return new DMap.CurveLine(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.CurveLine.printable = true;
DMap.Class('Ellipse', DMap.Round, {
  _lonlats: [], lonlatAndLengthShort: null, initialize: function (a, c, b) {
    if (a instanceof Array) {
      this._lonlats = a;
    } else {
      alert(gisapi.lonlatArrayError);
      return;
    }
    DMap.Polygon.prototype.initialize.apply(this, arguments);
    this.lonlatAndLengthShort = this.getCenterAndLengthShort(a);
    this._outRingLonlats = this._fromLonlatAndLengthShortToLonlatArray();
  }, getCenterAndLengthShort: function (b) {
    var e = DMap.LonLatBounds.fromLonLatArray(b);
    var d = e.midLonLat();
    var a = DMap.Util.degreeToMeter(e.w() / 2);
    var c = DMap.Util.degreeToMeter(e.h() / 2);
    return [d, a, c];
  }, _fromLonlatAndLengthShortToLonlatArray: function () {
    var l = this.lonlatAndLengthShort[0];
    var r = this.lonlatAndLengthShort[1];
    var o = this.lonlatAndLengthShort[2];
    var n = this.lonlatAndLengthShort[1];
    var m = this.lonlatAndLengthShort[2];
    var f = 0;
    var j = 100;
    var p = [];
    var s = DMap.Util.distanceFrom(l, l.add(0, 0.1)) * 10;
    var d = DMap.Util.distanceFrom(l, l.add(0.1, 0)) * 10;
    var c = (360 / j) || 10;
    var e = -1;
    var t = 0;
    for (var q = t; q <= 360.001 + t; q += c) {
      var k = e ? r : n;
      var a = e ? o : m;
      e = -1 - e;
      var g = k * Math.cos(q * Math.PI / 180);
      var h = a * Math.sin(q * Math.PI / 180);
      var u = (h * Math.cos(f) - g * Math.sin(f)) / d;
      var b = (g * Math.cos(f) + h * Math.sin(f)) / s;
      p.push(new DMap.LonLat(l.lon + u, l.lat + b));
    }
    return p;
  }, setLonLatAndOther: function (a) {
    this.lonlatAndLengthShort = a;
    this._outRingLonlats = this._fromLonlatAndLengthShortToLonlatArray();
    this._setPath();
  }, getLonLatAndOther: function () {
    return [this.lonlatAndLengthShort[0].clone(), this.lonlatAndLengthShort[1], this.lonlatAndLengthShort[2]];
  }, setLonlats: function (a) {
    if (a instanceof Array) {
      this._lonlats = a;
    } else {
      alert(gisapi.lonlatArrayError);
      return;
    }
    this._lonlats = a;
    this.lonlatAndLengthShort = this.getCenterAndLengthShort(a);
    this._outRingLonlats = this._fromLonlatAndLengthShortToLonlatArray();
    this._setPath();
  }, getLonLats: function () {
    return this._lonlats;
  }, copy: function () {
    return new DMap.Ellipse(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }, CLASS_NAME: 'DMap.Ellipse'
});
DMap.Ellipse.clone = function (a) {
};
DMap.Ellipse.printable = true;
DMap.Class('Sector', DMap.Round, {
  _lonlatAndOther: null, _lonlats: [], initialize: function (c, b, a) {
    DMap.Polygon.prototype.initialize.apply(this, arguments);
    this._lonlats = c;
    this._lonlatAndOther = this.getParameterArray(c);
    this._outRingLonlats = this._fromlonlatAndOtherToLonlatArray();
  }, getParameterArray: function (h) {
    var b;
    var a = h[0];
    var e = DMap.Util.measureDistance([h[0], h[1]]);
    var g = DMap.Util.quadrant(h[0], h[1]);
    var f = DMap.Util.quadrant(h[0], h[2]);
    var d = 180 / Math.PI * Math.atan(((h[0].lon - h[1].lon)) / (h[0].lat - h[1].lat));
    var c = 180 / Math.PI * Math.atan(((h[0].lon - h[2].lon)) / (h[0].lat - h[2].lat));
    if (g == 3) {
      if (f == 3) {
        d = d - 180;
        c = c - 180;
      } else {
        if (f == 4) {
          d = d - 180;
          c = c - 270;
        } else {
          if (f == 1) {
            d = d - 180;
            c = c;
          } else {
            if (f == 2) {
              d = d - 180;
              c = c;
            }
          }
        }
      }
    }
    if (g == 4) {
      if (f == 3) {
        d = -270 - d;
        c = c - 180;
      } else {
        if (f == 4) {
          d = -270 - d;
          c = -270 - c;
        } else {
          if (f == 1) {
            d = -270 - d;
            c = c;
          } else {
            if (f == 2) {
              d = -270 - d;
              c = c;
            }
          }
        }
      }
    }
    if (d > c) {
      b = c;
      c = d;
      d = b;
    }
    return [a, e, d, c];
  }, _fromlonlatAndOtherToLonlatArray: function () {
    var f = [];
    var b = this._lonlatAndOther[0];
    var a = this._lonlatAndOther[1];
    var c = this._lonlatAndOther[2];
    var e = this._lonlatAndOther[3];
    var g = ((e - c) / 10) || 10;
    f.push(b);
    for (var d = c; d < e + 0.001; d += g) {
      f.push(this.EOffsetBearing(b, a, d));
    }
    f.push(b);
    return f;
  }, EOffsetBearing: function (a, g, c) {
    var f = DMap.Util.distanceFrom(a, a.add(0, 0.1)) * 10;
    var d = DMap.Util.distanceFrom(a, a.add(0.1, 0)) * 10;
    var e = g * Math.cos(c * Math.PI / 180) / f;
    var b = g * Math.sin(c * Math.PI / 180) / d;
    return new DMap.LonLat(a.lon + b, a.lat + e);
  }, setLonLatAndOther: function (a) {
    this._lonlatAndOther = this.getParameterArray(a);
    this._outRingLonlats = this._fromlonlatAndOtherToLonlatArray();
    this._setPath();
  }, getLonLatAndOther: function () {
    return [this._lonlatAndOther[0], this._lonlatAndOther[1], this._lonlatAndOther[2], this._lonlatAndOther[3]];
  }, getLonLats: function () {
    return this._lonlats;
  }, copy: function () {
    return new DMap.Sector(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }, enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLatAndOther(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('drag', a);
    };
    for (var c = 0, b = this.getLonLats().length - 1; c < b; c++) {
      d(this.getLonLats()[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, CLASS_NAME: 'DMap.Sector'
});
DMap.Sector.clone = function (a) {
  return new DMap.Sector(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.Sector.printable = true;
DMap.Class('Triangle', DMap.Polygon, {
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var a = function (g) {
      e._outRingLonlats[this.index] = this._lonlat;
      e._outRingLonlats[3] = e._outRingLonlats[0];
      e.setLonlats(e._outRingLonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('drag', a);
    };
    var f = this.getLonLats();
    for (var c = 0, b = f.length - 1; c < b; c++) {
      d(f[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, copy: function () {
    return new DMap.Triangle(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }, CLASS_NAME: 'DMap.Triangle'
});
DMap.Triangle.clone = function (a) {
  return new DMap.Triangle(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.Triangle.printable = true;
DMap.Class('RoundRect', DMap.Polygon, {
  _lonlats: [], initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    DMap.Polygon.prototype.initialize.apply(this, arguments);
    this._outRingLonlats = this._fromlonlatAndOtherToLonlatArray();
  }, redraw: function (a) {
    if (this.clipPath || a) {
      this._setPath();
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  }, _fromlonlatAndOtherToLonlatArray: function () {
    var s = DMap.LonLatBounds.fromLonLatArray(this.getLonLats());
    var x = [];
    var y = s.wn();
    var u = s.es();
    var v = new DMap.LonLat(u.lon, y.lat);
    var t = new DMap.LonLat(y.lon, u.lat);
    var r = DMap.Util.degreeToMeter(s.w());
    var o = DMap.Util.degreeToMeter(s.h());
    var q = (r + o) / 20;
    var a = DMap.Util.getDegreeFromMeasure(q);
    var m = y.add(0, -a);
    var k = y.add(a, 0);
    var h = v.add(-a, 0);
    var g = v.add(0, -a);
    var f = u.add(0, a);
    var e = u.add(-a, 0);
    var d = t.add(a, 0);
    var c = t.add(0, a);
    var p = y.add(a, -a);
    var n = v.add(-a, -a);
    var l = u.add(-a, a);
    var j = t.add(a, a);
    var b = (90 / 10) || 10;
    for (var w = 270; w < 360 + 0.001; w += b) {
      x.push(this.EOffsetBearing(p, q, w));
    }
    for (var w = 0; w < 90 + 0.001; w += b) {
      x.push(this.EOffsetBearing(n, q, w));
    }
    for (var w = 90; w < 180 + 0.001; w += b) {
      x.push(this.EOffsetBearing(l, q, w));
    }
    for (var w = 180; w < 270 + 0.001; w += b) {
      x.push(this.EOffsetBearing(j, q, w));
    }
    x.push(x[0]);
    return x;
  }, EOffsetBearing: function (a, g, c) {
    var f = DMap.Util.distanceFrom(a, a.add(0, 0.1)) * 10;
    var d = DMap.Util.distanceFrom(a, a.add(0.1, 0)) * 10;
    var e = g * Math.cos(c * Math.PI / 180) / f;
    var b = g * Math.sin(c * Math.PI / 180) / d;
    return new DMap.LonLat(a.lon + b, a.lat + e);
  }, setLonlats: function (a) {
    DMap.EhlException.isTypeRight(a, 'undefined');
    DMap.EhlException._isArray(a);
    this._lonlats = a;
    this._outRingLonlats = this._fromlonlatAndOtherToLonlatArray();
    this._setPath();
  }, getLonLats: function () {
    return this._lonlats;
  }, enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      if (this.index == 0) {
        e._lonlats[0] = e._lonlats[4] = this._lonlat;
        e._lonlats[1] = new DMap.LonLat(e._lonlats[2].lon, e._lonlats[0].lat);
        e._lonlats[3] = new DMap.LonLat(e._lonlats[0].lon, e._lonlats[2].lat);
      } else {
        if (this.index == 1) {
          e._lonlats[0] = e._lonlats[4] = new DMap.LonLat(e._lonlats[0].lon, this._lonlat.lat);
          e._lonlats[1] = this._lonlat;
          e._lonlats[2] = new DMap.LonLat(this._lonlat.lon, e._lonlats[2].lat);
        } else {
          if (this.index == 2) {
            e._lonlats[1] = new DMap.LonLat(this._lonlat.lon, e._lonlats[1].lat);
            e._lonlats[2] = this._lonlat;
            e._lonlats[3] = new DMap.LonLat(e._lonlats[3].lon, this._lonlat.lat);
          } else {
            if (this.index == 3) {
              e._lonlats[0] = e._lonlats[4] = new DMap.LonLat(this._lonlat.lon, e._lonlats[0].lat);
              e._lonlats[2] = new DMap.LonLat(e._lonlats[2].lon, this._lonlat.lat);
              e._lonlats[3] = this._lonlat;
            }
          }
        }
      }
      e.setLonlats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    var f = this.getLonLats();
    for (var c = 0, b = f.length - 1; c < b; c++) {
      d(f[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, copy: function () {
    return new DMap.RoundRect(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }, CLASS_NAME: 'DMap.RoundRect'
});
DMap.RoundRect.clone = function (a) {
  return new DMap.RoundRect(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.RoundRect.printable = true;
DMap.Class('PlanInfoWindow', DMap.Overlay, {
  planWidth: null,
  planHeight: null,
  planShow: null,
  pointShowUrl: 'blue-dot.png',
  pointShowColor: 'blue',
  pointBorderColor: 'red',
  addOverLayer: null,
  imgsymbol: null,
  recsymbol: null,
  polygonLineSymbol: null,
  _callBack: null,
  addAttribute: {},
  planOperate: null,
  delCallBack: null,
  cancleEditBack: null,
  defaultImage: null,
  oldEditPlan: null,
  planImageHost: '',
  planObject: null,
  _fyaDiv: null,
  _symbolArray: [],
  initialize: function (b) {
    this._contentContainers = [];
    this.arrowWidth = 98;
    this.arrowHeight = 96;
    b = b || {};
    this._map = b.map || map;
    this.planWidth = b.planWidth || 270;
    this.planHeight = b.planHeight || 210;
    this.planAry = b.planAry || new Array();
    this._textDiv = document.createElement('div');
    var a = document.createElement('div');
    this._textDiv.appendChild(a);
    this._contentContainers.push(a);
    var d = document.createElement('div');
    this._textDiv.appendChild(d);
    this._contentContainers.push(d);
    var c = document.createElement('div');
    this._textDiv.appendChild(c);
    this._contentContainers.push(c);
    this.createColorWindow();
    planObject = this;
    this._fyaDiv = b.divName;
    this.initData();
  },
  initData: function () {
    var me = this;
    DMap.$.ajax({
      type: 'post', url: m_mapgis + '/servlet/SymbolServlet?method=ManageSymbol', success: function (data) {
        var opt = {};
        opt.imgurl = m_mapgis + '/extendControl/Accordion/img/';
        var accordion = new Accordion(opt);
        var _dataObj = eval('(' + data + ')');
        for (var i = 0; i < _dataObj.length; i++) {
          var _id = _dataObj[i].FLDM;
          var _div = DMap.Util.createDiv({id: 'menu_' + _id});
          var _name = _dataObj[i].FLMC;
          me.initFldmtoQuery(_id);
          DMap.$('#' + me._fyaDiv).append(_div);
          accordion.addItem(_div, _name);
        }
      }, error: function () {
        alert(gisapi.PlanInfoWindow_error);
      }
    });
  },
  initFldmtoQuery: function (_id) {
    DMap.$.ajax({
      type: 'post',
      url: m_mapgis + '/servlet/SymbolServlet?method=QueryMenuById&fldm=' + _id,
      success: function (data) {
        var _dataObj = eval('(' + data + ')');
        var pictureUrl = m_mapgis + '/servlet/ShowImgServlet?type=3&id=';
        for (var i = 0; i < _dataObj.length; i++) {
          var _html = '';
          _html += '<img src=' + pictureUrl + _dataObj[i].ID + ' alt=\'' + _dataObj[i].ZLMC + '\' onclick=\'planObject._switchType("' + _dataObj[i].ZLDM + '",' + _dataObj[i].ID + ')\'></img>';
          DMap.$('#menu_' + _id).append(_html);
        }
      },
      error: function () {
        alert(gisapi.PlanInfoWindow_error);
      }
    });
  },
  _switchType: function (a, c) {
    var d = this;
    var b = {table: a, id: c};
    switch (a) {
      case'SYSTEM_CLEAR':
        DMap.$('#' + this._map._panelMarkerId).empty();
        this._map.clearOverlays();
        break;
      case'SYSTEM_SELECTED':
        break;
      case'TB_SECTOR':
        d.addSectorPlan(function (e) {
          e.type = 4;
          d._symbolArray.push(e);
        });
        break;
      case'TB_RECTANGLE':
        d.addRoundRectPlan(function (e) {
          e.type = 8;
          d._symbolArray.push(e);
        });
        break;
      case'TB_ROUND':
        d.addRoundPlan(function (e) {
          e.type = 9;
          d._symbolArray.push(e);
        });
        break;
      case'TB_POLYLINE':
      case'TB_WARNLINE':
        d.addLinePlan(function (e) {
          e.type = 2;
          d._symbolArray.push(e);
        });
        break;
      case'TB_ROUNDRECT':
        d.addRoundRectPlan(function (e) {
          e.type = 8;
          d._symbolArray.push(e);
        });
        break;
      case'TB_ELLIPSE':
        d.addEllipsePlan(function (e) {
          e.type = 10;
          d._symbolArray.push(e);
        });
        break;
      case'TB_FONT':
        d.addFontPlan(function (e) {
          e.type = 11;
          d._symbolArray.push(e);
        });
        break;
      case'TB_POLYGON':
        d.addPolygonPlan(function (e) {
          e.type = 5;
          d._symbolArray.push(e);
        });
        break;
      case'TB_TRIANGLE':
        d.addTrianglePlan(function (e) {
          e.type = 6;
          d._symbolArray.push(e);
        });
        break;
      case'TB_CURVELINE':
        d.addCurveLinePlan(function (e) {
          e.type = 3;
          d._symbolArray.push(e);
        });
        break;
      case'TB_ONE_ACTIONARROW':
        d.addActionArrowPlan(function (e) {
          e.type = 30;
          d._symbolArray.push(e);
        });
        break;
      case'TB_TWO_ACTIONARROW':
        d.addDoubleActionArrowPlan(function (e) {
          e.type = 31;
          d._symbolArray.push(e);
        });
        break;
      case'TB_DIGITAL':
      case'TB_MARKER':
        d.addPointPlan(function (e) {
          e.type = 50;
          d._symbolArray.push(e);
        }, b);
        break;
      case'TB_CONTROLLINE':
        d.addControlLinePlan(function (e) {
          e.type = 60;
          d._symbolArray.push(e);
        });
        break;
      case'TB_HOLDAREALINE':
        d.addAreaControlLinePlan(function (e) {
          e.type = 61;
          d._symbolArray.push(e);
        });
        break;
      case'TB_FIRE':
        d.addFriePlan(function (e) {
          e.type = 62;
          d._symbolArray.push(e);
        });
        break;
      case'TB_FIRELINE':
        d.addWarnLinePlan(function (e) {
          e.type = 63;
          d._symbolArray.push(e);
        });
        break;
      case'TB_PRELINE':
        d.addPreLinePlan(function (e) {
          e.type = 64;
          d._symbolArray.push(e);
        });
        break;
      case'TB_SHOOTDOWN':
        d.addShutDownPlan(function (e) {
          e.type = 65;
          d._symbolArray.push(e);
        });
        break;
      case'TB_FIRETOATTACK':
        d.addFireToAttackPlan(function (e) {
          e.type = 66;
          d._symbolArray.push(e);
        });
        break;
    }
  },
  initSymbol: function (_name, _id) {
    DMap.$.ajax({
      type: 'post',
      async: false,
      url: m_mapgis + '/servlet/SymbolServlet?method=QuerySymbolByTable&id=' + _id + '&table=' + _name,
      success: function (data) {
        var dataObj = eval('(' + data + ')');
        temp = dataObj[0];
      },
      error: function () {
        alert(gisapi.PlanInfoWindow_error);
        return null;
      }
    });
    return temp;
  },
  initImgList: function (_div) {
    DMap.$.ajax({
      type: 'post',
      url: m_mapgis + '/servlet/SymbolServlet?method=PictureSelectAll',
      data: {proxyurl: m_mapgis + '/servlet/SymbolServlet?method=PictureSelectAll'},
      success: function (data) {
        var _dataObj = eval('(' + data + ')');
        var _html = '';
        var pictureUrl = m_mapgis + '/servlet/ShowImgServlet?type=1&id=';
        for (var i = 0; i < _dataObj.length; i++) {
          _dataObj[i]['picture'] = pictureUrl + _dataObj[i].id;
          _html += '<img src=' + pictureUrl + _dataObj[i].id + ' alt=\'' + _dataObj[i].name + '\' onclick=\'planObject._addMarker(' + DMap.$.toJSONString(_dataObj[i]) + ')\'></img>';
        }
        DMap.$(_div).append(_html);
      },
      error: function () {
        alert(gisapi.PlanInfoWindow_error);
        return null;
      }
    });
  },
  initDigital: function (_div) {
    DMap.$.ajax({
      type: 'post',
      url: m_mapgis + '/servlet/SymbolServlet?method=DigitalSelectAll',
      success: function (data) {
        var _dataObj = eval('(' + data + ')');
        var _html = '';
        var pictureUrl = m_mapgis + '/servlet/ShowImgServlet?type=2&id=';
        for (var i = 0; i < _dataObj.length; i++) {
          _dataObj[i]['picture'] = pictureUrl + _dataObj[i].id;
          _html += '<img src=' + pictureUrl + _dataObj[i].id + ' alt=\'' + _dataObj[i].name + '\' onclick=\'planObject._addMarker(' + DMap.$.toJSONString(_dataObj[i]) + ')\'></img>';
        }
        DMap.$(_div).append(_html);
      },
      error: function () {
        alert(gisapi.PlanInfoWindow_error);
        return null;
      }
    });
  },
  _addMarker: function (b) {
    var a = this;
    this.pointShowUrl = b.picture;
    this.addPointPlan(function (c) {
      c.type = 50;
      a._symbolArray.push(c);
    }, b);
  },
  setMap: function (a) {
    this._map = a;
  },
  addPointPlan: function (c, b) {
    this.planType = 50;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = this.initSymbol(b.table, b.id);
      this.addAttribute.picture = m_mapgis + '/servlet/ShowImgServlet?type=3&id=' + b.id;
    }
    this._map.activateTool('POINT', function (f, d) {
      a.getLonLat(d);
    });
  },
  editPointPlan: function (b, a, e, f, c) {
    this.closePlan();
    this.planType = 50;
    this.planOperate = 2;
    var d = this;
    this._callBack = f;
    this.pointShowUrl = a.image;
    this.imgsymbol = a;
    c._attr = e;
    this.addOverLayer = c;
    this.oldEditPlan = {type: 1, points: b, symbol: a, attribute: e};
    this.addOverLayer.setDragEvent();
    d.showInfoWindow(null, a, e);
  },
  addActionArrowPlan: function (c, b) {
    this.planType = 30;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('ACTION', function (f, d) {
      a.getLonLat(d);
    });
  },
  editActionArrowPlan: function (c, a, e, f, b) {
    this.closePlan();
    this.planType = 30;
    this.planOperate = 2;
    var d = this;
    this._callBack = f;
    this.polygonLineSymbol = a;
    this.addOverLayer = b;
    this.oldEditPlan = {type: 10, points: c, symbol: a, attribute: e};
    this.addOverLayer.enableEdit();
    this.addOverLayer.editable = false;
    this.addOverLayer.addListener('click', function () {
      d.showInfoWindow();
    });
    d.showInfoWindow(null, a, e);
  },
  addLinePlan: function (c, b) {
    this.planType = 2;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('POLYLINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addWarnLinePlan: function (c, b) {
    this.planType = 63;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addAreaControlLinePlan: function (c, b) {
    this.planType = 61;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addControlLinePlan: function (c, b) {
    this.planType = 60;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addFriePlan: function (c, b) {
    this.planType = 62;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addPreLinePlan: function (c, b) {
    this.planType = 64;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addFireToAttackPlan: function (c, b) {
    this.planType = 66;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addShutDownPlan: function (c, b) {
    this.planType = 65;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('LINE', function (f, d) {
      a.getLonLat(d);
    });
  },
  editLinePlan: function (c, a, e, f, b) {
    this.closePlan();
    this.planType = 2;
    this.planOperate = 2;
    var d = this;
    this._callBack = f;
    this.polygonLineSymbol = a;
    this.addOverLayer = b;
    this.addOverLayer.enableEditing();
    d.showInfoWindow(null, a, e);
  },
  addCurveLinePlan: function (c, b) {
    this.planType = 3;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('CURVE', function (f, d) {
      a.getLonLat(d);
    });
  },
  editCurveLinePlan: function (c, a, e, f, b) {
    this.planType = 3;
    this.planOperate = 2;
    this.addOverLayer = b;
    var d = this;
    this._callBack = f;
    this.addOverLayer.enableEditing();
    this.addOverLayer.editable = false;
    d.showInfoWindow(null, a, e);
  },
  addPolygonPlan: function (c, b) {
    this.planType = 5;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('POLYGON', function (f, d) {
      a.getLonLat(d);
    });
  },
  editPolygonPlan: function (c, a, e, f, b) {
    this.closePlan();
    this.planType = 5;
    this.planOperate = 2;
    var d = this;
    this._callBack = f;
    this.polygonLineSymbol = a;
    this.addOverLayer = b;
    this.oldEditPlan = {type: 3, points: c, symbol: a, attribute: e};
    this.addOverLayer.enableEdit();
    this.addOverLayer.editable = false;
    d.showInfoWindow(null, a, e);
  },
  addFontPlan: function (c, b) {
    this.planType = 11;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._callBack = c;
    this._map.activateTool('POINT', function (f, d) {
      a.getLonLat(d);
    });
  },
  editFontPlan: function (b, a, e, f, c) {
    this.closePlan();
    this.planType = 11;
    this.planOperate = 2;
    var d = this;
    this._callBack = f;
    this.recsymbol = a;
    this.addOverLayer = c;
    this.oldEditPlan = {type: 4, points: b, symbol: a, attribute: e};
    this.addOverLayer.enableEdit();
    this.addOverLayer.editable = false;
    d.showInfoWindow(null, a, e);
  },
  addTrianglePlan: function (c, b) {
    this.planType = 6;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('TRIANGLE', function (f, d) {
      a.getLonLat(d);
    });
  },
  editTrianglePlan: function (c, a, e, f, b) {
    this.planType = 6;
    this.planOperate = 2;
    var d = this;
    this._callBack = f;
    this.polygonLineSymbol = a;
    this.addOverLayer = b;
    this.addOverLayer.enableEditing();
    this.addOverLayer.editable = false;
    d.showInfoWindow(null, a, e);
  },
  addSectorPlan: function (c, b) {
    this.planType = 4;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('SECTOR', function (f, d) {
      a.getLonLat(d);
    });
  },
  addEllipsePlan: function (c, b) {
    this.planType = 10;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('ELLIPSE', function (f, d) {
      a.getLonLat(d);
    });
  },
  addRoundRectPlan: function (c, b) {
    this.planType = 8;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('ROUNDRECT', function (f, d) {
      a.getLonLat(d);
    });
  },
  addRoundPlan: function (c, b) {
    this.planType = 9;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('ROUND', function (f, d) {
      a.getLonLat(d);
    });
  },
  addRectPlan: function (c, b) {
    this.planType = 7;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('REC', function (f, d) {
      a.getLonLat(d);
    });
  },
  addDoubleActionArrowPlan: function (c, b) {
    this.planType = 31;
    this.planOperate = 1;
    this.closePlan();
    this.oldEditPlan = null;
    var a = this;
    this._callBack = c;
    if (b == null) {
      this.addAttribute = {};
    } else {
      this.addAttribute = b;
    }
    this._map.activateTool('TWOACTION', function (f, d) {
      a.getLonLat(d);
    });
  },
  getLonLat: function (p) {
    var l = this;
    var n;
    var m;
    if (this.planType == 50) {
      this.addOverLayer = new DMap.Marker(p, {
        url: this.addAttribute.picture,
        size: new DMap.Size(this.addAttribute.width, this.addAttribute.height)
      });
      this.addOverLayer.setCommonEvent();
      DMap.$(this.addOverLayer).bind('click', function (q) {
        l.showInfoWindow();
      });
      this._map.addOverlay(this.addOverLayer);
      this.addOverLayer.enableEditing();
    } else {
      if (this.planType == 1 || this.planType == 2) {
        var i = new DMap.Polyline(p, {color: '#0000FF', endarrow: 'Classic', weight: 5, animateFromColor: '#FF0000'});
        this.addOverLayer = i;
        this._map.addOverlay(this.addOverLayer);
        this.addOverLayer.setCommonEvent();
        this.addOverLayer.enableEditing();
        DMap.$(this.addOverLayer).bind('click', function (r, q) {
          l.showInfoWindow();
        });
      } else {
        if (this.planType == 5) {
          var h = new DMap.Polygon(p);
          this.addOverLayer = h;
          this._map.addOverlay(this.addOverLayer);
          this.addOverLayer.setCommonEvent();
          this.addOverLayer.enableEditing();
          DMap.$(this.addOverLayer).bind('click', function (q) {
            l.showInfoWindow();
          });
        } else {
          if (this.planType == 7) {
            var h = new DMap.Rectangle(p);
            this.addOverLayer = h;
            this._map.addOverlay(this.addOverLayer);
            this.addOverLayer.setCommonEvent();
            this.addOverLayer.enableEditing();
            DMap.$(this.addOverLayer).bind('click', function (q) {
              l.showInfoWindow();
            });
          } else {
            if (this.planType == 11) {
              var c = new DMap.Marker(p, {
                type: 2,
                textFontSize: 14,
                textBorderColor: '#0000FF',
                textColor: '#000000',
                textBackgroundColor: '#99FF99'
              });
              this.addOverLayer = c;
              this._map.addOverlay(this.addOverLayer);
              this.addOverLayer.setCommonEvent();
              this.addOverLayer.enableEditing();
              DMap.$(this.addOverLayer).bind('click', function (q) {
                l.showInfoWindow();
              });
            } else {
              if (this.planType == 30 || this.planType == 31) {
                var b = new DMap.ActionArrow(p, {weight: 0.5, fillColor: '#FF0000', fillColor2: '#0000FF'});
                this.addOverLayer = b;
                this._map.addOverlay(this.addOverLayer);
                b.setCommonEvent();
                DMap.$(b).bind('click', function (r, q) {
                  b.enableEditing();
                  l.showInfoWindow();
                });
              } else {
                if (this.planType == 6) {
                  var h = new DMap.Triangle(p);
                  this.addOverLayer = h;
                  this._map.addOverlay(this.addOverLayer);
                  this.addOverLayer.setCommonEvent();
                  this.addOverLayer.enableEditing();
                  DMap.$(this.addOverLayer).bind('click', function (q) {
                    l.showInfoWindow();
                  });
                } else {
                  if (this.planType == 3) {
                    var h = new DMap.CurveLine(p);
                    this.addOverLayer = h;
                    this._map.addOverlay(this.addOverLayer);
                    this.addOverLayer.setCommonEvent();
                    this.addOverLayer.enableEditing();
                    DMap.$(this.addOverLayer).bind('click', function (q) {
                      l.showInfoWindow();
                    });
                  } else {
                    if (this.planType == 4) {
                      var h = new DMap.Sector(p);
                      this.addOverLayer = h;
                      this._map.addOverlay(this.addOverLayer);
                      this.addOverLayer.setCommonEvent();
                      this.addOverLayer.enableEditing();
                      DMap.$(this.addOverLayer).bind('click', function (q) {
                        l.showInfoWindow();
                      });
                    } else {
                      if (this.planType == 10) {
                        var h = new DMap.Ellipse(p);
                        this.addOverLayer = h;
                        this._map.addOverlay(this.addOverLayer);
                        this.addOverLayer.setCommonEvent();
                        this.addOverLayer.enableEditing();
                        DMap.$(this.addOverLayer).bind('click', function (q) {
                          l.showInfoWindow();
                        });
                      } else {
                        if (this.planType == 8) {
                          var h = new DMap.RoundRect(p);
                          this.addOverLayer = h;
                          this._map.addOverlay(this.addOverLayer);
                          this.addOverLayer.setCommonEvent();
                          this.addOverLayer.enableEditing();
                          DMap.$(this.addOverLayer).bind('click', function (q) {
                            l.showInfoWindow();
                          });
                        } else {
                          if (this.planType == 9) {
                            var a = new DMap.Round([p[0], DMap.Util.degreeToMeter(p[1])], {fillColor: '#0000FF'});
                            this.addOverLayer = a;
                            this._map.addOverlay(this.addOverLayer);
                            this.addOverLayer.setCommonEvent();
                            this.addOverLayer.enableEditing();
                            DMap.$(this.addOverLayer).bind('click', function (q) {
                              l.showInfoWindow();
                            });
                          } else {
                            if (this.planType == 61) {
                              var k = new DMap.HoldAreaLine(p);
                              this.addOverLayer = k;
                              this._map.addOverlay(this.addOverLayer);
                              this.addOverLayer.setCommonEvent();
                              k.enableEditing();
                              DMap.$(this.addOverLayer).bind('click', function (q) {
                                l.showInfoWindow();
                              });
                            } else {
                              if (this.planType == 60) {
                                var g = new DMap.ControlLine(p);
                                this.addOverLayer = g;
                                this._map.addOverlay(this.addOverLayer);
                                g.enableEditing();
                                this.addOverLayer.setCommonEvent();
                                DMap.$(this.addOverLayer).bind('click', function (q) {
                                  l.showInfoWindow();
                                });
                              } else {
                                if (this.planType == 62) {
                                  var e = new DMap.Fire(p);
                                  this.addOverLayer = e;
                                  this._map.addOverlay(this.addOverLayer);
                                  this.addOverLayer.setCommonEvent();
                                  e.enableEditing();
                                  DMap.$(this.addOverLayer).bind('click', function (q) {
                                    l.showInfoWindow();
                                  });
                                } else {
                                  if (this.planType == 63) {
                                    var f = new DMap.FireLine(p);
                                    this.addOverLayer = f;
                                    this._map.addOverlay(this.addOverLayer);
                                    this.addOverLayer.setCommonEvent();
                                    f.enableEditing();
                                    DMap.$(this.addOverLayer).bind('click', function (q) {
                                      l.showInfoWindow();
                                    });
                                  } else {
                                    if (this.planType == 64) {
                                      var d = new DMap.PreLine(p);
                                      this.addOverLayer = d;
                                      this._map.addOverlay(this.addOverLayer);
                                      this.addOverLayer.setCommonEvent();
                                      d.enableEditing();
                                      DMap.$(this.addOverLayer).bind('click', function (q) {
                                        l.showInfoWindow();
                                      });
                                    } else {
                                      if (this.planType == 65) {
                                        var j = new DMap.ShutDown(p);
                                        this.addOverLayer = j;
                                        this._map.addOverlay(this.addOverLayer);
                                        this.addOverLayer.setCommonEvent();
                                        j.enableEditing();
                                        DMap.$(this.addOverLayer).bind('click', function (q) {
                                          l.showInfoWindow();
                                        });
                                      } else {
                                        if (this.planType == 66) {
                                          var o = new DMap.FireToAttack(p);
                                          this.addOverLayer = o;
                                          this._map.addOverlay(this.addOverLayer);
                                          this.addOverLayer.setCommonEvent();
                                          o.enableEditing();
                                          DMap.$(this.addOverLayer).bind('click', function (q) {
                                            l.showInfoWindow();
                                          });
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    this._map.deactivate();
    l.showInfoWindow();
  },
  showInfoWindow: function (e, b, d) {
    var a;
    var c;
    if (this.addOverLayer != null) {
      b = b || this.buildSymbol();
      d = d || this.buildAttribute();
      if (this.planType == 50) {
        a = this.addOverLayer.getLonlat();
        c = this.putPointText(b, d);
      } else {
        if (this.planType == 2 || this.planType == 63 || this.planType == 61 || this.planType == 60 || this.planType == 62 || this.planType == 64 || this.planType == 65 || this.planType == 66) {
          a = this.addOverLayer.getLonLats()[1];
          c = this.putPolyLineText(b, d);
        } else {
          if (this.planType == 11) {
            a = this.addOverLayer.getLonlat();
            c = this.putFontText(b, d);
          } else {
            if (this.planType == 6 || this.planType == 4 || this.planType == 10 || this.planType == 30 || this.planType == 5 || this.planType == 8 || this.planType == 7 || this.planType == 31) {
              a = this.addOverLayer.getLonLatBounds().midLonLat();
              c = this.putTriangleText(b, d);
            } else {
              if (this.planType == 3) {
                a = this.addOverLayer.parmLonlats[1];
                c = this.putPolyLineText(b, d);
              } else {
                if (this.planType == 9) {
                  a = this.addOverLayer.getLonlatAndR()[0];
                  c = this.putTriangleText(b, d);
                }
              }
            }
          }
        }
      }
    }
    this._map.openInfoWindowHtml(a, c, {size: new DMap.Size(320, 350)});
  },
  delAddPlan: function () {
    if (this.addOverLayer != null) {
      var a = this;
      this.refresh();
      a.hide();
      if (a.delCallBack != null) {
        this.delCallBack.call(this);
      }
    }
  },
  addLineStyleOptions: function (a) {
    var b = ['none', 'dash', 'dashdot', 'dot', 'longdash', 'longdashdot', 'shortdash', 'shortdashdot', 'shortdashdotdot', 'longdashdotdot', 'shortdot'];
    var c = ['________', '- - - --', '-.-.-.-.', '........', '___ ___', '___.___', '- - - -', '__ . __', '__ . .', '____ . .', '........'];
    var e = '';
    for (var d = 0; d < b.length; d++) {
      var f = '';
      if (b[d] == a) {
        f = 'selected';
      }
      e += '<option value="' + b[d] + '" ' + f + '>' + c[d] + '</option>';
    }
    return e;
  },
  addSymbolStyleOptions: function (a) {
    var b = ['0', '1'];
    var c = [gisapi.PlanInfoWindow_is, gisapi.PlanInfoWindow_no];
    var e = '';
    for (var d = 0; d < b.length; d++) {
      var f = '';
      if (b[d] == a) {
        f = 'selected';
      }
      e += '<option value="' + b[d] + '" ' + f + '>' + c[d] + '</option>';
    }
    return e;
  },
  addPolongyStyleOptions: function (a) {
    var e = ['solid', 'gradient', 'gradientradial', 'tile', 'pattern', 'frame'];
    var c = '';
    for (var b = 0; b < e.length; b++) {
      var d = '';
      if (e[b] == a) {
        d = 'selected';
      }
      c += '<option value="' + e[b] + '" ' + d + '>' + e[b] + '</option>';
    }
    return c;
  },
  openStartarrow: function (n, m, g) {
    var j = this;
    var k = 'line_arrow' + g;
    this.line_arrow_div = document.getElementById(k);
    this._contentContainers[1] = document.getElementById('div2');
    if (this.line_arrow_div == null) {
      var b = '<div id=' + k + ' style=\'background:#BBBBBB;padding:0px;left:' + n + ';top:' + m + ';display:block;z-index:110;position:absolute;\' onmouseleave=\'planObject.closeStartarrow(' + g + ');\'>';
      var c = [['none.PNG', 'none'], ['block.PNG', 'block'], ['classic.PNG', 'classic'], ['diamond.PNG', 'diamond'], ['oval.PNG', 'oval'], ['open.PNG', 'open']];
      var h = document.createElement('table');
      var d = h.createTHead();
      DMap.$(h).attr({cellpadding: '0px', cellspacing: '0px'});
      for (var f = 0; f < c.length; f++) {
        var e = '<img arrowType=\'' + c[f][1] + '\' src=\'' + gisapi.getImageUrl(c[f][0]) + '\' style=\'cursor:hand;width:60;\' onclick=\'planObject.chooseLineArrow(' + g + ',this.arrowType)\'></img>';
        var a = d.insertRow(f);
        var l = a.insertCell(0);
        l.innerHTML = e;
      }
      b += h.outerHTML;
      b += '</div>';
      this._contentContainers[1].innerHTML += b;
    } else {
      this.line_arrow_div.style.display = 'block';
    }
  },
  changeFontCon: function (b) {
    var a = b.value;
    if (a.length == 0) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.symbol.text;
      return;
    }
    this.addOverLayer.setText(a);
  },
  changeFontSize: function (b) {
    var a = b.value;
    if (parseInt(a) * 1 != a) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.fontSize;
      return;
    }
    this.addOverLayer.symbol.fontSize = parseInt(a);
    this.addOverLayer.redraw();
  },
  closeStartarrow: function (a) {
    this.line_arrow_div = document.getElementById('line_arrow' + a);
    DMap.$(this.line_arrow_div).css('display', 'none');
  },
  chooseLineArrow: function (b, a) {
    this.line_sarrow_Img = document.getElementById('line_sarrow_Img');
    this.line_earrow_Img = document.getElementById('line_earrow_Img');
    if (b == 1) {
      this.addOverLayer.symbol.startarrow = a;
      DMap.$(this.line_sarrow_Img).attr('src', gisapi.getImageUrl(a + '.PNG'));
    } else {
      if (b == 2) {
        this.addOverLayer.symbol.endarrow = a;
        DMap.$(this.line_earrow_Img).attr('src', gisapi.getImageUrl(a + '.PNG'));
      }
    }
    this.closeStartarrow(b);
  },
  putPointPacity: function (b) {
    var a = b.value;
    if (a * 1 != a || parseFloat(a) > 1 || parseFloat(a) < 0) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.recsymbol.opacity;
      return;
    }
    this.recsymbol = DMap.$.extend(this.recsymbol, {opacity: parseFloat(a)});
    this.addOverLayer.setSymbol(this.recsymbol);
  },
  putPointWidth: function (b) {
    var a = b.value;
    if (parseInt(a) * 1 != a) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.recsymbol.size.w;
      return;
    }
    this.recsymbol = DMap.$.extend(this.recsymbol, {size: new DMap.Size(parseInt(a), this.recsymbol.size.h)});
    this.addOverLayer.setSymbol(this.recsymbol);
  },
  putPointHeight: function (b) {
    var a = b.value;
    if (parseInt(a) * 1 != a) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.recsymbol.size.h;
      return;
    }
    this.recsymbol = DMap.$.extend(this.recsymbol, {size: new DMap.Size(this.recsymbol.size.w, parseInt(a))});
    this.addOverLayer.setSymbol(this.recsymbol);
  },
  chooseColor: function (b, d, c) {
    var a = this;
    this.chooseColorDivIndex = c;
    this._colo_div.reset(b, d);
    this._colo_div.show(function (e) {
      a.chooseColorBack(e);
    });
  },
  chooseColorBack: function (a) {
    this.planShow = document.getElementById('planShow') || null;
    this.color_border_div = document.getElementById('color_border_div');
    this.color_fill_div = document.getElementById('color_fill_div');
    this.animate_fill_div = document.getElementById('animate_fill_div');
    if (this.chooseColorDivIndex == 1) {
      $(this.color_point_fill_div).css('backgroundColor', '#' + a);
      this.pointShowColor = '#' + a;
      $(this.planShow).css({
        width: '20',
        height: '20',
        backgroundColor: this.pointShowColor,
        cursor: 'hand'
      }).bind('click', function () {
        me.changeDiv(3);
      });
    } else {
      if (this.chooseColorDivIndex == 2) {
        this.pointBorderColor = '#' + a;
        $(this.color_border_div).css('backgroundColor', '#' + a);
      } else {
        if (this.chooseColorDivIndex == 3) {
          DMap.$('#color_border_div').css('backgroundColor', '#' + a);
          DMap.$('#color_border_div').val('#' + a);
        } else {
          if (this.chooseColorDivIndex == 4) {
            DMap.$('#color_fill_div').css('backgroundColor', '#' + a);
            DMap.$('#color_fill_div').val('#' + a);
          } else {
            if (this.chooseColorDivIndex == 5) {
              $(this.planShow).css({backgroundColor: '#' + a});
              $(this.color_fill_div2).css('backgroundColor', '#' + a);
            } else {
              if (this.chooseColorDivIndex == 6) {
                DMap.$('#animate_fill_div').css('backgroundColor', '#' + a);
                DMap.$('#animate_fill_div').val('#' + a);
              }
            }
          }
        }
      }
    }
  },
  changePointWidth: function (b) {
    var a = b.value;
    if (parseInt(a) * 1 != a) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.icon.width;
      return;
    }
    if (this.addOverLayer != null) {
      this.addOverLayer._dom.style.width = parseInt(a) + 'px';
    }
  },
  changePointHieght: function (b) {
    var a = b.value;
    if (parseInt(a) * 1 != a) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.icon.height;
      return;
    }
    if (this.addOverLayer != null) {
      this.addOverLayer._dom.style.height = parseInt(a) + 'px';
    }
  },
  changePolyLineW: function (b) {
    var a = b.value;
    if (parseInt(a) * 1 != a) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.weight;
      return;
    }
    this.addOverLayer.setWeight(parseInt(a));
  },
  putPolyLinePacity: function (b) {
    var a = b.value;
    if (a * 1 != a || parseFloat(a) > 1 || parseFloat(a) < 0) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.getOpacity();
      return;
    }
    this.addOverLayer.setOpacity(parseFloat(a));
  },
  putPolygonPacity: function (b) {
    var a = b.value;
    if (a * 1 != a || parseFloat(a) > 1 || parseFloat(a) < 0) {
      alert(gisapi.PlanInfoWindow_error);
      b.value = this.addOverLayer.getFillOpacity();
      return;
    }
    this.addOverLayer.setFillOpacity(parseFloat(a));
  },
  changeDiv: function (a) {
    this.hideColordiv();
    if (a == 1) {
      document.getElementById('div1').style.display = '';
      document.getElementById('div2').style.display = 'none';
    } else {
      if (a == 2) {
        document.getElementById('div1').style.display = 'none';
        document.getElementById('div2').style.display = '';
      }
    }
  },
  setDelCallBack: function (a) {
    this.delCallBack = a;
  },
  setCancleEditBack: function (a) {
    this.cancleEditBack = a;
  },
  setDefaultImage: function (a) {
    this.defaultImage = a;
    this.pointShowUrl = a;
  },
  removeOverLayer: function (a) {
    if (a != null) {
      this._map.removeOverlay(a);
      a = null;
    }
  },
  createImgHtml: function () {
    var e = '';
    var h = 32;
    for (var d = 0; d < this.imagesAry.length; d++) {
      var c = this.imagesAry[d];
      var b = imgWT = c.size.split(',')[0];
      var a = imgHT = c.size.split(',')[1];
      if ((b > a) && (b > (h + 3))) {
        b = h - 2;
        a = b / imgWT * imgHT;
      } else {
        if (a > (h + 3)) {
          a = h - 2;
          b = a / imgHT * imgWT;
        }
      }
      var g = parseInt((h - a) / 2);
      var f = parseInt((h - b) / 2);
      e += '<div style="float:left;border:1px solid blue;width:' + h + ';height:' + h + ';overflow:hidden; text-align:center;" ><IMG style="WIDTH: ' + b + 'px; position:absolute;top:' + g + ';left:' + f + ';CURSOR: hand; HEIGHT: ' + a + 'px;" src="' + EhlGis.fyaImagePath + c.image + '"  alt="' + c.title + '" onclick="plan.chooseMarkImage(' + d + ')" /></div>';
    }
    this.imageHtml = e;
  },
  putPointText: function (b, a) {
    b = b || {height: '32', width: '32', image: this.pointShowUrl};
    a = a || {title: '', destribute: ''};
    var c = '<DIV style="OVERFLOW: auto; WIDTH: 300px; HEIGHT: 300px">';
    c += '<TABLE width="95%" border=0>';
    c += '<THEAD>';
    c += '<TR></TR>';
    c += '<TR>';
    c += '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setTitle_text + '</FONT><INPUT id="plan_title" onblur="planObject.checkGJZ(this);if(planObject.addOverLayer.titleDiv) plan.addOverLayer.titleDiv.innerHTML = this.value; plan.plan_title=this.value;" size=10 value="' + this.addAttribute.name + '"></TD>';
    c += '<TD align=right>';
    c += '<TR>';
    c += '<TD colSpan=2><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setDestribute_text + '</FONT></TD></TR>';
    c += '<TR>';
    c += '<TD colSpan=2><TEXTAREA onblur="planObject.plan_des = this.value;" id="plan_des" style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px">' + this.addAttribute.description + '</TEXTAREA></TD></TR>';
    c += '<TR>';
    c += '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPointText_height + '</FONT><INPUT id="imgHeight" size=3 onblur="planObject.changePointHieght(this);" value="' + this.addAttribute.height + '"><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPointText_width + '</FONT><INPUT id="imgWidth" size=3 onblur="planObject.changePointWidth(this);" value="' + this.addAttribute.width + '"></TD></TR>';
    c += '<TD>';
    c += '</TD>';
    c += '<TR>';
    c += '<TD align=center><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_ok + ' onclick="planObject.submitPointPlan(1);"><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_cancel + ' onclick="planObject.closePlan(true);"></TD></TR></THEAD>';
    c += '</TABLE></DIV>';
    this.planShow = true;
    return c;
  },
  changeLineStyle: function (b) {
    var a = this;
    a.value = b.options[b.selectedIndex].value;
  },
  putPolyLineText: function (b, a) {
    b = b || {color: 'red', weight: 5, opacity: 0.7, startarrow: 'oval', endarrow: 'classic', lineStyle: 'none'};
    a = a || {appName: '', appDescription: '', isDefalut: '0'};
    var c = ['<DIV id="div2">', '<DIV style="OVERFLOW: auto; WIDTH: 300px; HEIGHT: 300px">', '<TABLE width="95%" border=0>', '<THEAD>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setTitle_text + '</FONT><INPUT id="plan_title" onblur="planObject.checkGJZ(this);planObject.plan_title=this.value;" size=10 value="' + a.appName + '"></TD>', '<TD align=right>', '</TD></TR>', '<TR>', '<TD colSpan=2><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setDestribute_text + '</FONT></TD></TR>', '<TR>', '<TD colSpan=2><TEXTAREA id="plan_des" onblur="planObject.plan_des = this.value;" style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px">' + a.appDescription + '</TEXTAREA></TD></TR>', '<TR>', '<TD></TD>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_symbolName + '</FONT><INPUT id="symbol_title" onblur="planObject.checkGJZ(this);planObject.plan_title=this.value;" size=10></TD>', '<TD align=right>', '</TD></TR>', '<TD colSpan=2><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_symbolDescription + '</FONT></TD></TR>', '<TR>', '<TD colSpan=2><TEXTAREA id="symbol_des" onblur="planObject.symbol_des = this.value;" style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px" ></TEXTAREA></TD></TR>', '<TR>', '<TD></TD>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolyLineText_xdys + '</FONT></TD>', '<TD><SELECT style="FONT-SIZE: 12px; WIDTH: 80px" onchange="planObject.changeLineStyle(this);" id="lineStyle" value=' + b.lineStyle + ' >' + this.addLineStyleOptions(b.lineStyle) + '</SELECT>', '</TD></TR>', '<TR>', '<TD width=100><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolyLineText_xtys + '</FONT></TD>', '<TD>', '<DIV id="color_border_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.color + '" value="' + b.color + '" onclick="planObject.chooseColor(115,40,3);"></DIV></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_gdys + '</FONT></TD>', '<TD>', '<DIV id="animate_fill_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.animateColor + '" value="' + b.animateColor + '" onclick="planObject.chooseColor(115,40,6);"></DIV></TD></TR>', '<TR>', '<TR>', '<TD width=100><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolyLineText_xtkd + '</FONT></TD>', '<TD><INPUT size=2 id="plan_weight"  onblur="planObject.changePolyLineW(this);" value="' + b.weight + '"></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolyLineText_tmd + '</FONT></TD>', '<TD><INPUT size=2 id="boderfillOpacity"  value="' + b.opacity + '" onblur="planObject.putPolyLinePacity(this);"></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolyLineText_qsjt + '</FONT></TD>', '<TD><IMG height=15 id="line_sarrow_Img" src="' + gisapi.getImageUrl(b.startarrow + '.PNG') + '" value="' + b.startarrow + '"  width=60 onclick="planObject.openStartarrow(110,115+25,1);"></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolyLineText_zdjt + '</FONT></TD>', '<TD><IMG height=15 id="line_earrow_Img" src="' + gisapi.getImageUrl(b.endarrow + '.PNG') + '" value="' + b.endarrow + '" width=60 onclick="planObject.openStartarrow(110,140+20,2);"></TD></TR>', '<TD align=right><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_ok + ' onclick="planObject.submitPointPlan(1);"><INPUT type=button value=' + gisapi.PlanInfoWindow_saveSymbol + ' onclick="planObject.submitPointPlan(2);"><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_cancel + ' onclick="planObject.closePlan(true);"></TD></TR></THEAD>', '</THEAD>', '<TBODY></TBODY></TABLE></DIV>', this._colo_div._colorDiv.innerHTML, '</DIV>'].join('');
    this.planShow = true;
    return c;
  },
  createColorWindow: function () {
    this._colo_div = new DMap.ColorWindow();
  },
  putFontText: function (b, a) {
    b = b || {name: '', fontSize: '14'};
    a = a || {appName: '', appDescription: ''};
    var c = ['<DIV>', '<DIV style="OVERFLOW: auto; WIDTH: 300px; HEIGHT: 300px">', '<TABLE width="95%" border=0>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setTitle_text + '</FONT><INPUT id="plan_title" size=10 value="' + a.appName + '" onblur="planObject.checkGJZ(this);planObject.changeFontCon(this);">', '<FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putFontText_wzdx + '</FONT>', '<INPUT size=2 id="fontSize" value="' + b.fontSize + '" onblur="planObject.changeFontSize(this);"></TD></TR>', '<TR>', '<TD ><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setDestribute_text + '</FONT></TD></TR>', '<TR>', '<TD ><TEXTAREA id="plan_des" onblur="planObject.plan_des = this.value;"  style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px" >' + a.appDescription + '</TEXTAREA></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_symbolName + '  </FONT><INPUT id="symbol_title" onblur="planObject.checkGJZ(this);planObject.plan_title=this.value;" size=10></TD>', '<TD align=right>', '</TD></TR>', '<TD colSpan=2><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_symbolDescription + '</FONT></TD></TR>', '<TR>', '<TD colSpan=2><TEXTAREA id="symbol_des" onblur="planObject.symbol_des = this.value;" style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px" ></TEXTAREA></TD></TR>', '<TR>', '<TD ><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_fontColor + '</FONT></TD>', '<TD>', '<DIV id="color_border_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.textColor + '" value="' + b.textColor + '" onclick="planObject.chooseColor(115,40,3);"></DIV></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_textBackgroundColor + '</FONT></TD>', '<TD>', '<DIV id="color_fill_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.textBackgroundColor + '" value="' + b.textBackgroundColor + '" onclick="planObject.chooseColor(115,40,4);"></DIV></TD></TR>', '<TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_textBorderColor + '</FONT></TD>', '<TD>', '<DIV id="animate_fill_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.textBorderColor + '" value="' + b.textBorderColor + '" onclick="planObject.chooseColor(115,40,6);"></DIV></TD></TR>', '<TD align=center><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_ok + ' onclick="planObject.submitPointPlan(1);" ><INPUT type=button value=' + gisapi.PlanInfoWindow_saveSymbol + ' onclick="planObject.submitPointPlan(2);"><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_cancel + ' onclick="planObject.closePlan(true);"></TD></TR>', '</TABLE></DIV>', this._colo_div._colorDiv.innerHTML, '</DIV>'].join('');
    this.planShow = true;
    return c;
  },
  putTriangleText: function (b, a) {
    var d = this;
    var c = ['<DIV id="div1">', '<DIV style="OVERFLOW: auto; WIDTH: 300px; HEIGHT: 300px">', '<TABLE width="95%" border=0>', '<THEAD>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setTitle_text + '</FONT><INPUT id="plan_title" onblur="planObject.checkGJZ(this);planObject.plan_title=this.value;" size=10 value="' + a.appName + '"></TD>', '<TD align=right>', '</TD></TR>', '<TD colSpan=2><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_setDestribute_text + '</FONT></TD></TR>', '<TR>', '<TD colSpan=2><TEXTAREA id="plan_des" onblur="planObject.plan_des = this.value;" style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px" >' + a.appDescription + '</TEXTAREA></TD></TR>', '<TR>', '<TD></TD>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_symbolName + '</FONT><INPUT id="symbol_title" onblur="planObject.checkGJZ(this);planObject.plan_title=this.value;" size=10></TD>', '<TD align=right>', '</TD></TR>', '<TD colSpan=2><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_symbolDescription + '</FONT></TD></TR>', '<TR>', '<TD colSpan=2><TEXTAREA id="symbol_des" onblur="planObject.symbol_des = this.value;" style="OVERFLOW: auto; WIDTH: 99%; HEIGHT: 100px" ></TEXTAREA></TD></TR>', '<TR>', '<TD></TD>', '<TR>', '<TD width=100><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_bxys + '</FONT></TD>', '<TD>', '<DIV id="color_border_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.color + '" value="' + b.color + '" onclick="planObject.chooseColor(115,40,3);"></DIV></TD></TR>', '<TR>', '<TD width=100><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_bxkd + '</FONT></TD>', '<TD><INPUT size=2 id="plan_weight" value=' + b.weight + ' onblur="planObject.changePolyLineW(this);"></TD></TR>', '<TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_bxyangs + '</FONT></TD>', '<TD><SELECT style="FONT-SIZE: 12px; WIDTH: 80px" id="lineStyle" onchange="planObject.changeLineStyle(this);" value=' + b.lineStyle + ' >' + this.addLineStyleOptions(b.lineStyle) + '</SELECT>', '</TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_ploylineFillType + '</FONT></TD>', '<TD><SELECT style="FONT-SIZE: 12px; WIDTH: 80px" id="polongyType" onchange="planObject.changeLineStyle(this);" value=' + b.fillType + ' >' + this.addPolongyStyleOptions(b.fillType) + '</SELECT>', '</TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_tcys + '</FONT></TD>', '<TD>', '<DIV id="color_fill_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.fillColor + '" value="' + b.fillColor + '" onclick="planObject.chooseColor(115,40,4);"></DIV></TD></TR>', '<TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_gdys + '</FONT></TD>', '<TD>', '<DIV id="animate_fill_div" style="cursor:hand;WIDTH: 20px; HEIGHT: 20px; BACKGROUND-COLOR: ' + b.animateFromColor + '" value="' + b.animateFromColor + '" onclick="planObject.chooseColor(115,40,6);"></DIV></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_bxtmd + '</FONT></TD>', '<TD><INPUT size=2 id="boderfillOpacity" value=' + b.opacity + ' onblur="planObject.putPolyLinePacity(this);"></TD></TR>', '<TR>', '<TD><FONT style="FONT-SIZE: 12px">' + gisapi.PlanInfoWindow_putPolygonText_tmd + '</FONT></TD>', '<TD><INPUT size=2 id="fillOpacity" value=' + b.fillOpacity + ' onblur="planObject.putPolygonPacity(this);"></TD></TR>', '<TD align=right><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_ok + ' onclick="planObject.submitSJXPlan(1);"><INPUT type=button value=' + gisapi.PlanInfoWindow_saveSymbol + ' onclick="planObject.submitSJXPlan(2);"><INPUT type=button value=' + gisapi.PlanInfoWindow_setCommonEnd_cancel + ' onclick="planObject.closePlan(true);"></TD></TR></THEAD>', '<TBODY></TBODY></TABLE></DIV>', this._colo_div._colorDiv.innerHTML, '</DIV>'].join('');
    this.planShow = true;
    return c;
  },
  refresh: function () {
    this.planShow = null;
    if (this.defaultImage != null) {
      this.pointShowUrl = this.defaultImage;
    } else {
      this.pointShowUrl = gisapi.getImageUrl('blue-dot.png');
    }
    this.pointShowColor = 'blue';
    this.pointBorderColor = 'red';
    this.imgsymbol = null;
    this.recsymbol = null;
    if (this.planOperate == 1 && !this.oldEditPlan) {
    }
    if (this.addOverLayer) {
      this.addOverLayer.editable = true;
      this.addOverLayer.disableEditing();
    }
    this.polygonLineSymbol = null;
    this.line_arrow_div = null;
    this.plan_des = '';
    this.plan_title = '';
    this.hide();
  },
  hideColordiv: function () {
    if (this._colo_div != null) {
      this._colo_div.hide();
    }
  },
  hide: function () {
    this.hideColordiv();
    this._map.closeInfoWindow();
  },
  buildSymbol: function () {
    var b = {};
    var a = this.addOverLayer;
    switch (this.planType) {
      case 50:
        b.image = this.pointShowUrl.substring(this.pointShowUrl.lastIndexOf('/') + 1);
        b.height = this.addOverLayer.getSymbol().size.h;
        b.width = this.addOverLayer.getSymbol().size.w;
        break;
      case 6:
      case 4:
      case 9:
      case 10:
      case 30:
      case 5:
      case 8:
      case 7:
      case 31:
        b.color = a.symbol.color;
        b.opacity = a.symbol.opacity;
        b.animateFromColor = a.symbol.animateFromColor;
        b.weight = a.symbol.weight;
        b.lineStyle = a.symbol.dashstyle;
        b.fillColor = a.symbol.fillColor;
        b.fillOpacity = a.symbol.fillOpacity;
        b.fillType = a.symbol.fillType;
        break;
      case 3:
      case 2:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
      case 65:
      case 66:
        b.color = a.symbol.color;
        b.lineStyle = a.symbol.dashstyle;
        b.weight = parseInt(a.symbol.weight);
        b.opacity = parseInt(a.symbol.opacity);
        b.startarrow = a.symbol.startarrow;
        b.endarrow = a.symbol.endarrow;
        b.animateColor = a.symbol.animateColor;
        break;
      case 11:
        b.name = a.symbol.text;
        b.fontSize = parseInt(a.symbol.labelFontSize);
        b.textBorderColor = a.symbol.textBorderColor;
        b.textBackgroundColor = a.symbol.textBackgroundColor;
        b.textColor = a.symbol.textColor;
        b.type = a.symbol.type;
        break;
    }
    return b;
  },
  buildAttribute: function () {
    try {
      this.plan_title = document.getElementById('plan_title').value;
      this.plan_des = document.getElementById('plan_des').value;
    } catch (b) {
    }
    var a = this.addOverLayer._attr || {};
    a.appName = this.plan_title || '';
    a.appDescription = this.plan_des || '';
    return a;
  },
  submitPointPlan: function (k) {
    var a = {};
    var d = '';
    var C = null;
    var I = DMap.$('#plan_title').val();
    var t = DMap.$('#plan_des').val();
    var D = DMap.$('#symbolDefault').val();
    var j = DMap.$('#symbol_title').val();
    var u = DMap.$('#symbol_des').val();
    if (I == null || I.length == 0) {
      alert(gisapi.PlanInfoWindow_titleIsNotNull);
      return;
    }
    switch (this.planType) {
      case 50:
        var h = DMap.$('#imgHeight').val();
        var H = DMap.$('#imgWidth').val();
        var B = this.addOverLayer.getLonlat();
        d = 'POINT(' + B.lon + ' ' + B.lat + ')';
        var l = this.addOverLayer.getUrl();
        var z = {name: j, description: u, width: h, height: H, url: l, type: this.planType};
        if (k == 1) {
          a = {appName: I, appDescription: t, lonlats: d, symbol: DMap.$.toJSONString(z)};
        }
        this._callBack.call(this, a);
        break;
      case 3:
      case 2:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
      case 65:
      case 66:
        var w = DMap.$('#color_border_div').val();
        var q = DMap.$('#plan_weight').val();
        var b = DMap.$('#lineStyle').val();
        var p = DMap.$('#animate_fill_div').val();
        var e = DMap.$('#boderfillOpacity').val();
        var E = DMap.$('#line_sarrow_Img').val();
        var v = DMap.$('#line_earrow_Img').val();
        var o = this.addOverLayer.getStartarrowwidth();
        var G = this.addOverLayer.getStartarrowlength();
        var s = this.addOverLayer.getEndarrowwidth();
        var r = this.addOverLayer.getEndarrowlength();
        if (this.planType == 3) {
          C = this.addOverLayer._lonlats;
          this.addOverLayer.setSymbol({
            color: w,
            weight: q,
            dashstyle: b,
            opacity: e,
            animateColor: p,
            startarrow: E,
            endarrow: v
          });
        } else {
          if (this.planType == 2) {
            C = this.addOverLayer.getLonLats();
            this.addOverLayer.setSymbol({
              color: w,
              weight: q,
              dashstyle: b,
              opacity: e,
              animateColor: p,
              startarrow: E,
              endarrow: v
            });
          } else {
            if (this.planType == 60 || this.planType == 61 || this.planType == 62 || this.planType == 63 || this.planType == 64 || this.planType == 65 || this.planType == 66) {
              C = this.addOverLayer.getLonLats();
              this.addOverLayer.setSymbolForHold({
                color: w,
                weight: q,
                dashstyle: b,
                opacity: e,
                animateColor: p,
                startarrow: E,
                endarrow: v
              });
            }
          }
        }
        d = 'LINESTRING(';
        for (var A = 0; A < C.length; A++) {
          var n = C[A].lon;
          var m = C[A].lat;
          d += n + ' ' + m + ',';
        }
        d = d.substring(0, d.lastIndexOf(','));
        d += ')';
        var z = {
          name: j,
          description: u,
          color: w,
          opacity: e,
          weight: q,
          dashstyle: b,
          animateColor: p,
          startarrow: E,
          endarrow: v,
          startarrowwidth: o,
          startarrowlength: G,
          endarrowwidth: s,
          endarrowlength: r,
          type: this.planType
        };
        if (k == 1) {
          a = {appName: I, appDescription: t, lonlats: d, symbol: DMap.$.toJSONString(z)};
        }
        if (k == 2) {
          a = {symbol: DMap.$.toJSONString(z)};
          DMap.$.ajax({
            type: 'post',
            url: m_mapgis + '/servlet/SymbolServlet?method=add&ehlType=' + this.planType,
            data: a,
            success: function (i) {
              alert(gisapi.PlanInfoWindow_saveSymbolSuccess);
            },
            error: function (i) {
              alert(gisapi.PlanInfoWindow_error);
            }
          });
        }
        this._callBack.call(this, a);
        break;
      case 11:
        var c = DMap.$('#fontSize').val();
        var g = DMap.$('#color_border_div').val();
        var f = DMap.$('#color_fill_div').val();
        var F = DMap.$('#animate_fill_div').val();
        C = this.addOverLayer.getLonlat();
        d = 'POINT(' + C.lon + ' ' + C.lat + ')';
        this.addOverLayer.setSymbol({fontSize: c, textColor: g, textBackgroundColor: f, textBorderColor: F});
        var z = {
          name: j,
          description: u,
          fontSize: c,
          textColor: g,
          textBackgroundColor: f,
          textBorderColor: F,
          type: this.planType
        };
        if (k == 1) {
          a = {appName: I, appDescription: t, lonlats: d, symbol: DMap.$.toJSONString(z)};
        }
        if (k == 2) {
          a = {symbol: DMap.$.toJSONString(z)};
          DMap.$.ajax({
            type: 'post',
            url: m_mapgis + '/servlet/SymbolServlet?method=add&ehlType=' + this.planType,
            data: a,
            success: function (i) {
              alert(gisapi.PlanInfoWindow_saveSymbolSuccess);
            },
            error: function (i) {
              alert(gisapi.PlanInfoWindow_error);
            }
          });
        }
        this._callBack.call(this, a);
        break;
    }
    this.refresh();
    this._map.closeInfoWindow();
  },
  submitSJXPlan: function (u) {
    var s = null;
    var a = {};
    var d = '';
    var v = DMap.$('#plan_title').val();
    if (v == null || v.length == 0) {
      alert(gisapi.PlanInfoWindow_titleIsNotNull);
      return;
    }
    var n = DMap.$('#plan_des').val();
    var t = DMap.$('#symbolDefault').val();
    var p = DMap.$('#color_border_div').val();
    var l = DMap.$('#plan_weight').val();
    var c = DMap.$('#lineStyle').val();
    var k = DMap.$('#polongyType').val();
    var f = DMap.$('#color_fill_div').val();
    var b = DMap.$('#animate_fill_div').val();
    var e = DMap.$('#boderfillOpacity').val();
    var q = DMap.$('#fillOpacity').val();
    if (this.planType == 4) {
      s = this.addOverLayer.getLonLats();
      d = 'POLYGON((';
      for (var r = 0; r < s.length; r++) {
        var j = s[r].lon;
        var h = s[r].lat;
        d += j + ' ' + h + ',';
      }
      d = d.substring(0, d.lastIndexOf(',')) + '))';
    } else {
      if (this.planType == 9) {
        s = this.addOverLayer.getLonlatAndR().toString();
        d = s;
      } else {
        if (this.planType == 10) {
          s = this.addOverLayer.getLonLatAndOther().toString();
          d = s;
        } else {
          s = this.addOverLayer.getLonLats();
          d = 'POLYGON((';
          for (var r = 0; r < s.length; r++) {
            var j = s[r].lon;
            var h = s[r].lat;
            d += j + ' ' + h + ',';
          }
          d = d.substring(0, d.lastIndexOf(',')) + '))';
        }
      }
    }
    var g = DMap.$('#symbol_title').val();
    var m = DMap.$('#symbol_des').val();
    var o = {
      name: g,
      description: m,
      isDefault: t,
      color: p,
      weight: l,
      dashstyle: c,
      fillType: k,
      fillColor: f,
      animateFromColor: b,
      opacity: e,
      fillOpacity: q,
      type: this.planType
    };
    this.addOverLayer.setSymbol({
      weight: parseInt(l),
      dashstyle: c,
      fillType: k,
      opacity: e,
      fillOpacity: q,
      fillColor: f
    });
    if (u == 1) {
      a = {appName: v, appDescription: n, lonlats: d, symbol: DMap.$.toJSONString(o)};
      this._callBack.call(this, a);
    }
    if (u == 2) {
      a = {symbol: DMap.$.toJSONString(o)};
      DMap.$.ajax({
        type: 'post',
        url: m_mapgis + '/servlet/SymbolServlet?method=add&ehlType=' + this.planType,
        data: a,
        success: function (i) {
          alert(gisapi.PlanInfoWindow_saveSymbolSuccess);
        },
        error: function (i) {
          alert(gisapi.PlanInfoWindow_error);
        }
      });
    }
    this.refresh();
    this._map.closeInfoWindow();
  },
  closePlan: function (a) {
    this.refresh();
  },
  checkGJZ: function (e) {
    var f = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '"', '\'', '~'];
    var d = e.value;
    for (var b = 0; b < d.length; b++) {
      var c = d.substring(b, b + 1);
      for (var a in f) {
        if (c == f[a]) {
          alert(gisapi.PlanInfoWindow_validate + f[a]);
          e.value = '';
          e.focus();
          return;
        }
      }
    }
  }
});
DMap.Class('ControlLine', DMap.Polyline, {
  idPrefix: null,
  _lonlats: null,
  _dom: null,
  _symbol: null,
  _controlLineArray: [],
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    var c = this.getCurvePoints(this._lonlats);
    this._dom = document.getElementById(this.idPrefix);
  },
  getCurvePoints: function (v) {
    var n = 6;
    var g = 30;
    var f = v[0];
    var e = v[1];
    var c = this._map.fromLonLatToDivPixel(f);
    var b = this._map.fromLonLatToDivPixel(e);
    var x = parseInt(Math.ceil(DMap.Util.pointDistance(c, b)));
    var A;
    if (x <= 30) {
      A = 1;
    } else {
      A = parseInt(x / g);
    }
    A++;
    var C = 3 * A;
    var E = 2 * A + 1;
    var j = new Array(C + 1);
    var d = new Array(E + 1);
    j[0] = c;
    j[C] = b;
    var u = DMap.Util.getLineKX(c, b)[0];
    var t = DMap.Util.getLineKX(c, b)[1];
    for (var w = 1; w <= A; w++) {
      var y = DMap.Util.getPointToLineDistance(u, j[3 * w - 3], n);
      d[2 * w - 2] = y[0];
      d[2 * w - 1] = y[1];
      var q = DMap.Util.getLinePoint(u, t, j[0], j[C], w / A);
      var B = DMap.Util.getLinePoint(u, t, j[3 * w - 3], q, 0.4);
      var z = DMap.Util.getLinePoint(u, t, j[3 * w - 3], q, 0.6);
      j[3 * w] = q;
      j[3 * w - 1] = z;
      j[3 * w - 2] = B;
    }
    var D = A - 1;
    if (D > 0) {
      var a = DMap.Util.getPointToLineDistance(u, j[C], n);
      d[E - 1] = a[0];
      d[E] = a[1];
      var B = DMap.Util.getLinePoint(u, t, j[C - 3], j[C], 0.4);
      var z = DMap.Util.getLinePoint(u, t, j[C - 3], j[C], 0.6);
      j[C - 1] = z;
      j[C - 2] = B;
    }
    var m = j.length - 1;
    for (var w = 0; w < m; w += 3) {
      DMap.Polyline.prototype.initialize.call(this, [this._map.fromDivPixelToLonLat(j[w]), this._map.fromDivPixelToLonLat(j[w + 1])]);
      var s = new DMap.Polyline([this._map.fromDivPixelToLonLat(j[w]), this._map.fromDivPixelToLonLat(j[w + 1])], this._symbol);
      var p = new DMap.Polyline([this._map.fromDivPixelToLonLat(j[w + 2]), this._map.fromDivPixelToLonLat(j[w + 3])], this._symbol);
      s._map = this._map;
      p._map = this._map;
      s._setPath();
      p._setPath();
      DMap.$('#' + this.idPrefix).append(s.getDoms());
      DMap.$('#' + this.idPrefix).append(p.getDoms());
      this._controlLineArray.push(s);
      this._controlLineArray.push(p);
    }
    var h = d.length;
    for (var w = 0; w < h; w += 2) {
      var o = new DMap.Polyline([this._map.fromDivPixelToLonLat(d[w]), this._map.fromDivPixelToLonLat(d[w + 1])], this._symbol);
      o._map = this._map;
      o._setPath();
      DMap.$('#' + this.idPrefix).append(o.getDoms());
      this._controlLineArray.push(o);
    }
  },
  redraw: function (c) {
    if (this.clipPath || c) {
      for (var b = 0, a = this._controlLineArray.length; b < a; b++) {
        this._controlLineArray[b]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._controlLineArray.length > 0) {
      for (var b = 0; b < this._controlLineArray.length; b++) {
        this._controlLineArray[b].setSymbol(this._symbol);
      }
    }
  },
  remove: function () {
    if (this._controlLineArray.length > 0) {
      for (var a = 0; a < this._controlLineArray.length; a++) {
        this._map.removeOverlay(this._controlLineArray[a]);
      }
    }
    this._controlLineArray = [];
  },
  setLonLats: function (a) {
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    for (var c = 0, b = this.getLonLats().length; c < b; c++) {
      d(this.getLonLats()[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      DMap.$('#' + this._map._panelMarkerId).empty();
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.ControlLine(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.ControlLine'
});
DMap.ControlLine.clone = function (a) {
  return new DMap.ControlLine(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.ControlLine.printable = true;
DMap.Class('HoldAreaLine', DMap.Polyline, {
  idPrefix: null,
  _lonlats: null,
  _holdAreaLine: [],
  _dom: null,
  _symbol: null,
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    this.getCurvePoints(this._lonlats);
    this._dom = document.getElementById(this.idPrefix);
  },
  redraw: function (b) {
    if (this.clipPath || b) {
      for (var a = 0; a < this._holdAreaLine.length; a++) {
        this._holdAreaLine[a]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  getCurvePoints: function (u) {
    var g = [];
    var e = 20;
    var o = u[0];
    var n = u[1];
    var b = this._map.fromLonLatToDivPixel(o);
    var a = this._map.fromLonLatToDivPixel(n);
    var m = parseInt(Math.ceil(DMap.Util.pointDistance(b, a)));
    var x;
    if (m <= e) {
      x = 1;
    } else {
      x = parseInt(m / e);
    }
    x++;
    var d = new Array(4 * x);
    var t = DMap.Util.getLineKX(b, a)[0];
    var s = DMap.Util.getLineKX(b, a)[1];
    var z = b;
    var j = DMap.Util.quadrant(o, n);
    for (var v = 1; v <= x; v++) {
      var p = DMap.Util.getLinePoint(t, s, b, a, v / x);
      var f = DMap.Util.getLinePoint(t, s, z, p, 1 / 6);
      var c = DMap.Util.getLinePoint(t, s, z, p, 5 / 6);
      var y = DMap.Util.getLinePoint(t, s, c, p, 1 / 2);
      var q = DMap.Util.getLinePoint(t, s, z, f, 1 / 2);
      d[(4 * v - 4)] = this.getPoint(j, q, t, s);
      d[(4 * v - 3)] = f;
      d[(4 * v - 2)] = c;
      d[(4 * v - 1)] = this.getPoint(j, y, t, s);
      z = p;
    }
    var A = d.length;
    for (var v = 3; v < A; v += 4) {
      g.push(this._map.fromDivPixelToLonLat(d[v - 3]));
      g.push(this._map.fromDivPixelToLonLat(d[v - 2]));
      g.push(this._map.fromDivPixelToLonLat(d[v - 2]));
      g.push(this._map.fromDivPixelToLonLat(d[v - 1]));
      g.push(this._map.fromDivPixelToLonLat(d[v - 1]));
      g.push(this._map.fromDivPixelToLonLat(d[v]));
    }
    for (var v = 0; v < g.length - 6; v += 6) {
      DMap.Polyline.prototype.initialize.call(this, g);
      var w = [];
      w[0] = g[v];
      w[1] = g[v + 1];
      w[2] = g[v + 2];
      w[3] = g[v + 3];
      w[4] = g[v + 4];
      w[5] = g[v + 5];
      var h = new DMap.Polyline(w, this._symbol);
      this._holdAreaLine.push(h);
      h._map = this._map;
      h._setPath();
      DMap.$('#' + this.idPrefix).append(h.getDoms());
    }
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._holdAreaLine.length > 0) {
      for (var c = 0, b = this._holdAreaLine.length; c < b; c++) {
        this._holdAreaLine[c].setSymbol(this._symbol);
      }
    }
  },
  getPoint: function (e, c, g, a) {
    var f = 5;
    var d = [];
    var h;
    d = DMap.Util.getPointToLineDistance(g, c, f);
    if (e == 1) {
      if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
        h = d[0];
      } else {
        h = d[1];
      }
    } else {
      if (e == 2) {
        if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
          h = d[0];
        } else {
          h = d[1];
        }
      } else {
        if (e == 3) {
          if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
            h = d[0];
          } else {
            h = d[1];
          }
        } else {
          if (e == 4) {
            if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
              h = d[0];
            } else {
              h = d[1];
            }
          } else {
            if (e == 5) {
              if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
                h = d[0];
              } else {
                h = d[1];
              }
            } else {
              if (e == 8) {
                if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
                  h = d[0];
                } else {
                  h = d[1];
                }
              } else {
                if (e == 6) {
                  if (DMap.Util.pointToLinePosition(d[0], g, a) > 0) {
                    h = d[0];
                  } else {
                    h = d[1];
                  }
                } else {
                  if (DMap.Util.pointToLinePosition(d[0], g, a) < 0) {
                    h = d[0];
                  } else {
                    h = d[1];
                  }
                }
              }
            }
          }
        }
      }
    }
    return h;
  },
  remove: function () {
    if (this._holdAreaLine.length > 0) {
      for (var a = 0; a < this._holdAreaLine.length; a++) {
        this._map.removeOverlay(this._holdAreaLine[a]);
      }
      DMap.Util.removeNode(this._dom);
      this._dom = null;
      this._map = null;
    }
    this._holdAreaLine = [];
    DMap.Polyline.prototype.remove.call(this, arguments);
  },
  setLonLats: function (a) {
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    if (this._editMarkerArray.length > 0) {
      for (var c = 0; c < this._editMarkerArray.length; c++) {
        this._editMarkerArray[c].remove();
        this._editMarkerArray[c] = null;
      }
      this._editMarkerArray = [];
    }
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      DMap.$('#' + this._map._panelMarkerId).empty();
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.HoldAreaLine(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.HoldAreaLine'
});
DMap.HoldAreaLine.clone = function (a) {
  return new DMap.HoldAreaLine(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.HoldAreaLine.printable = true;
DMap.Class('Rectangle', DMap.Polygon, {
  initialize: function (c, b, a) {
    DMap.Polygon.prototype.initialize.apply(this, arguments);
    if (c instanceof Array) {
      this._lonlats = c;
    } else {
      alert(gisapi.lonlatArrayError);
      return;
    }
    this._outRingLonlats = c;
  }, enableEditing: function () {
    var f;
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var h = function (j) {
      for (var k = 0; k < e._editMarkerArray.length; k++) {
        if (e._editMarkerArray[k].index == j) {
          return e._editMarkerArray[k];
        }
      }
    };
    var a = function (j) {
      e._outRingLonlats[this.index] = this._lonlat;
      var i = DMap.Util.quadrant(f, this._lonlat);
      var k = DMap.LonLatBounds.fromLonLatArray(e._outRingLonlats);
      if (this.index == 0) {
        e._outRingLonlats[0] = e._outRingLonlats[4] = this._lonlat;
        e._outRingLonlats[2] = k.es();
        e._outRingLonlats[1] = new DMap.LonLat(e._outRingLonlats[2].lon, e._outRingLonlats[0].lat);
        e._outRingLonlats[3] = new DMap.LonLat(e._outRingLonlats[0].lon, e._outRingLonlats[2].lat);
      } else {
        if (this.index == 1) {
          e._outRingLonlats[0] = e._outRingLonlats[4] = new DMap.LonLat(e._outRingLonlats[0].lon, this._lonlat.lat);
          e._outRingLonlats[1] = this._lonlat;
          e._outRingLonlats[2] = new DMap.LonLat(this._lonlat.lon, e._outRingLonlats[2].lat);
        } else {
          if (this.index == 2) {
            e._outRingLonlats[1] = new DMap.LonLat(this._lonlat.lon, e._outRingLonlats[1].lat);
            e._outRingLonlats[2] = this._lonlat;
            e._outRingLonlats[3] = new DMap.LonLat(e._outRingLonlats[3].lon, this._lonlat.lat);
          } else {
            if (this.index == 3) {
              e._outRingLonlats[0] = e._outRingLonlats[4] = new DMap.LonLat(this._lonlat.lon, e._outRingLonlats[0].lat);
              e._outRingLonlats[2] = new DMap.LonLat(e._outRingLonlats[2].lon, this._lonlat.lat);
              e._outRingLonlats[3] = this._lonlat;
            }
          }
        }
      }
      e.setLonlats(e._outRingLonlats);
    };
    var d = function (k, j) {
      var i = new DMap.Marker(k, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(j) == j ? 1 : 0.5).setDragEvent();
      i.index = j;
      f = e._outRingLonlats[j];
      i.draw(e._map);
      e._editMarkerArray.push(i);
      DMap.$(i).bind('dragend', a);
    };
    var g = this.getLonLats();
    g.pop();
    for (var c = 0, b = g.length; c < b; c++) {
      d(g[c], c);
    }
  }, disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  }, isEditing: function () {
    return this._isEditing;
  }, copy: function () {
    return new DMap.Rectangle(this.getLonLats(), this.getSymbol(), this.getAttributes());
  }, CLASS_NAME: 'DMap.Rectangle'
});
DMap.Rectangle.clone = function (a) {
  return new DMap.Rectangle(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.Rectangle.printable = true;
DMap.Class('FireLine', DMap.Polyline, {
  idPrefix: null,
  _dom: null,
  _symbol: null,
  _lonlats: null,
  _fireLineLineArray: [],
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    this.getCurvePoints(this._lonlats);
  },
  getCurvePoints: function (u) {
    var d = 10;
    var n = u[0];
    var m = u[1];
    var b = this._map.fromLonLatToDivPixel(n);
    var a = this._map.fromLonLatToDivPixel(m);
    var j = parseInt(Math.ceil(DMap.Util.pointDistance(b, a)));
    var w;
    if (j <= d) {
      w = 3;
    } else {
      w = parseInt(j / d);
      var x = w % 2;
      if (x == 0) {
        w++;
      }
    }
    var f = w + 1;
    var g = new Array(f);
    var c = new Array(f);
    g[0] = b;
    g[w] = a;
    var t = DMap.Util.getLineKX(b, a)[0];
    var s = DMap.Util.getLineKX(b, a)[1];
    var h = DMap.Util.quadrant(n, m);
    for (var v = 1; v < w; v++) {
      var p = DMap.Util.getLinePoint(t, s, g[0], g[w], v / w);
      g[v] = p;
      if (v % 2 == 0) {
        continue;
      }
      var z = DMap.Util.getLinePoint(t, s, g[v - 1], g[v], 1 / 2);
      c[v - 1] = z;
      c[v] = DMap.Util.getPoint_fire(h, z, t, s);
    }
    var e = DMap.Util.getLinePoint(t, s, g[w - 1], g[w], 1 / 2);
    c[w - 1] = e;
    c[w] = DMap.Util.getPoint_fire(h, e, t, s);
    var y = g.length;
    for (var v = 0; v < y; v += 2) {
      DMap.Polyline.prototype.initialize.call(this, [this._map.fromDivPixelToLonLat(g[v]), this._map.fromDivPixelToLonLat(g[v + 1])]);
      var q = new DMap.Polyline([this._map.fromDivPixelToLonLat(g[v]), this._map.fromDivPixelToLonLat(g[v + 1])], this._symbol);
      var o = new DMap.Polyline([this._map.fromDivPixelToLonLat(c[v]), this._map.fromDivPixelToLonLat(c[v + 1])], this._symbol);
      q._map = this._map;
      o._map = this._map;
      q._setPath();
      o._setPath();
      DMap.$('#' + this.idPrefix).append(q.getDoms());
      DMap.$('#' + this.idPrefix).append(o.getDoms());
      this._fireLineLineArray.push(q);
      this._fireLineLineArray.push(o);
    }
    this._dom = document.getElementById(this.idPrefix);
  },
  redraw: function (b) {
    if (this.clipPath || b) {
      for (var a = 0; a < this._fireLineLineArray.length; a++) {
        this._fireLineLineArray[a]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._fireLineLineArray.length > 0) {
      for (var c = 0, b = this._fireLineLineArray.length; c < b; c++) {
        this._fireLineLineArray[c].setSymbol(this._symbol);
      }
    }
  },
  remove: function () {
    if (this._fireLineLineArray && this._fireLineLineArray.length > 0) {
      for (var a = 0; a < this._fireLineLineArray.length; a++) {
        this._map.removeOverlay(this._fireLineLineArray[a]);
      }
    }
    this._fireLineLineArray = [];
  },
  setLonLats: function (a) {
    this._fireLineLineArray = [];
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    if (this._editMarkerArray.length > 0) {
      for (var c = 0; c < this._editMarkerArray.length; c++) {
        this._editMarkerArray[c].remove();
        this._editMarkerArray[c] = null;
      }
      this._editMarkerArray = [];
    }
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      DMap.$('#' + this._map._panelMarkerId).empty();
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.FireLine(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.FireLine'
});
DMap.FireLine.clone = function (a) {
  return new DMap.FireLine(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.FireLine.printable = true;
DMap.Class('Fire', DMap.Polyline, {
  idPrefix: null,
  _lonlats: null,
  _dom: null,
  _symbol: null,
  _fireArray: [],
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    this.getCurvePoints(this._lonlats);
  },
  getCurvePoints: function (points) {
    var _array = new Array();
    var start = points[0];
    var end = points[1];
    var pixe1 = this._map.fromLonLatToDivPixel(start);
    var pixe2 = this._map.fromLonLatToDivPixel(end);
    var k = DMap.Util.getLineKX(pixe1, pixe2)[0];
    var l = DMap.Util.getLineKX(pixe1, pixe2)[1];
    var xiangxin = DMap.Util.quadrant(start, end);
    _array[0] = DMap.Util.getPoint(xiangxin, pixe1, k, l, true);
    var pt31 = DMap.Util.getLinePoint(k, l, pixe1, pixe2, 1 / 3);
    var pt32 = DMap.Util.getLinePoint(k, l, pixe1, pixe2, 2 / 3);
    _array[1] = DMap.Util.getLinePoint(k, l, pixe1, pixe2, 1 / 6);
    _array[2] = pt31;
    _array[3] = DMap.Util.getLinePoint(k, l, pt31, pt32, 1 / 6);
    _array[6] = DMap.Util.getLinePoint(k, l, pt31, pt32, 5 / 6);
    _array[4] = DMap.Util.centerPoint(_array[3], _array[6]);
    _array[5] = DMap.Util.getPoint(xiangxin, _array[4], k, l, false);
    _array[7] = pt32;
    _array[8] = DMap.Util.getLinePoint(k, l, pt32, pixe2, 5 / 6);
    _array[9] = DMap.Util.getPoint(xiangxin, pixe2, k, l, true);
    DMap.Polyline.prototype.initialize.call(this, [this._map.fromDivPixelToLonLat(_array[0]), this._map.fromDivPixelToLonLat(_array[1])]);
    var _polyline1 = new DMap.Polyline([this._map.fromDivPixelToLonLat(_array[0]), this._map.fromDivPixelToLonLat(_array[1])], this._symbol);
    var _polyline2 = new DMap.Polyline([this._map.fromDivPixelToLonLat(_array[1]), this._map.fromDivPixelToLonLat(_array[2])], this._symbol);
    var _polyline3 = new DMap.Polyline([this._map.fromDivPixelToLonLat(_array[3]), this._map.fromDivPixelToLonLat(_array[6])], this._symbol);
    var _polyline4 = new DMap.Polyline([this._map.fromDivPixelToLonLat(_array[4]), this._map.fromDivPixelToLonLat(_array[5])], this._symbol);
    var _polyline5 = new DMap.Polyline([this._map.fromDivPixelToLonLat(_array[7]), this._map.fromDivPixelToLonLat(_array[8])], this._symbol);
    var _polyline6 = new DMap.Polyline([this._map.fromDivPixelToLonLat(_array[8]), this._map.fromDivPixelToLonLat(_array[9])], this._symbol);
    for (var i = 1; i <= 6; i++) {
      var tt = eval('(_polyline' + i + ')');
      tt._map = this._map;
      tt._setPath();
      DMap.$('#' + this.idPrefix).append(tt.getDoms());
      this._fireArray.push(tt);
    }
    this._dom = document.getElementById(this.idPrefix);
  },
  redraw: function (b) {
    if (this.clipPath || b) {
      for (var a = 0; a < this._fireArray.length; a++) {
        this._fireArray[a]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._fireArray.length > 0) {
      for (var c = 0, b = this._fireArray.length; c < b; c++) {
        this._fireArray[c].setSymbol(this._symbol);
      }
    }
  },
  remove: function () {
    if (this._fireArray && this._fireArray.length > 0) {
      for (var a = 0; a < this._fireArray.length; a++) {
        this._map.removeOverlay(this._fireArray[a]);
      }
    }
    this._fireArray = [];
  },
  setLonLats: function (a) {
    this._fireArray = [];
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      DMap.$('#' + this._map._panelMarkerId).empty();
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.Fire(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.Fire'
});
DMap.Fire.clone = function (a) {
  return new DMap.Fire(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.Fire.printable = true;
DMap.Class('PreLine', DMap.Polyline, {
  idPrefix: null,
  _dom: null,
  _symbol: null,
  _lonlats: null,
  _preLineArray: [],
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    this.getCurvePoints(this._lonlats);
  },
  getCurvePoints: function (s) {
    var d = 40;
    var n = s[0];
    var m = s[1];
    var b = this._map.fromLonLatToDivPixel(n);
    var a = this._map.fromLonLatToDivPixel(m);
    var j = parseInt(Math.ceil(DMap.Util.pointDistance(b, a)));
    var u;
    if (j <= d) {
      u = 1;
    } else {
      u = parseInt(j / d);
      u++;
    }
    var c = new Array(5 * u);
    var v = b;
    var q = DMap.Util.getLineKX(b, a)[0];
    var p = DMap.Util.getLineKX(b, a)[1];
    var h = DMap.Util.quadrant(n, m);
    for (var t = 1; t <= u; t++) {
      var o = DMap.Util.getLinePoint(q, p, b, a, t / u);
      var g = DMap.Util.getLinePoint(q, p, v, o, 1 / 7);
      var e = DMap.Util.getLinePoint(q, p, v, o, 6 / 7);
      var f = DMap.Util.getLinePoint(q, p, v, o, 5 / 7);
      c[5 * t - 5] = g;
      c[5 * t - 4] = f;
      c[5 * t - 3] = DMap.Util.getPoint_fire(h, f, q, p);
      c[5 * t - 2] = DMap.Util.getPoint_fire(h, e, q, p);
      c[5 * t - 1] = e;
      v = o;
    }
    var w = c.length;
    for (var t = 4; t < w; t += 5) {
      DMap.Polyline.prototype.initialize.call(this, [this._map.fromDivPixelToLonLat(c[t - 4]), this._map.fromDivPixelToLonLat(c[t])]);
      var y = new DMap.Polyline([this._map.fromDivPixelToLonLat(c[t - 4]), this._map.fromDivPixelToLonLat(c[t])], this._symbol);
      var x = new DMap.Polygon([this._map.fromDivPixelToLonLat(c[t]), this._map.fromDivPixelToLonLat(c[t - 1]), this._map.fromDivPixelToLonLat(c[t - 2]), this._map.fromDivPixelToLonLat(c[t - 3])], this._symbol);
      y._map = this._map;
      x._map = this._map;
      y._setPath();
      x._setPath();
      DMap.$('#' + this.idPrefix).append(y.getDoms());
      DMap.$('#' + this.idPrefix).append(x.getDoms());
      this._preLineArray.push(y);
      this._preLineArray.push(x);
    }
    this._dom = document.getElementById(this.idPrefix);
  },
  redraw: function (b) {
    if (this.clipPath || b) {
      for (var a = 0; a < this._preLineArray.length; a++) {
        this._preLineArray[a]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._preLineArray.length > 0) {
      for (var c = 0, b = this._preLineArray.length; c < b; c++) {
        this._preLineArray[c].setSymbol(this._symbol);
      }
    }
  },
  remove: function () {
    if (this._preLineArray && this._preLineArray.length > 0) {
      for (var a = 0; a < this._preLineArray.length; a++) {
        this._map.removeOverlay(this._preLineArray[a]);
      }
    }
    this._preLineArray = [];
  },
  setLonLats: function (a) {
    this._preLineArray = [];
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    if (this._editMarkerArray.length > 0) {
      for (var c = 0; c < this._editMarkerArray.length; c++) {
        this._editMarkerArray[c].remove();
        this._editMarkerArray[c] = null;
      }
      this._editMarkerArray = [];
    }
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      DMap.$('#' + this._map._panelMarkerId).empty();
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.PreLine(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.PreLine'
});
DMap.PreLine.clone = function (a) {
  return new DMap.PreLine(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.PreLine.printable = true;
DMap.Class('ShutDown', DMap.Polyline, {
  idPrefix: null,
  _dom: null,
  _symbol: null,
  _lonlats: null,
  _shutDownArray: [],
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    var c = this.getCurvePoints(this._lonlats);
  },
  getCurvePoints: function (n) {
    var d = n[0];
    var i = n[1];
    var m = this._map.fromLonLatToDivPixel(d);
    var j = this._map.fromLonLatToDivPixel(i);
    var b = DMap.Util.centerPoint(m, j);
    var e = DMap.Util.pointDistance(m, j);
    var h = DMap.Util.getLineKX(m, j)[0];
    var g = DMap.Util.getLineKX(m, j)[1];
    var f = DMap.Util.quadrant(d, i);
    var o = this.shutDown_getPoint(f, b, h, g, 90, e / 2);
    DMap.Polyline.prototype.initialize.call(this, [d, i]);
    var c = new DMap.Polyline([d, i], this._symbol);
    var a = new DMap.Polyline([this._map.fromDivPixelToLonLat(o.PT1), this._map.fromDivPixelToLonLat(o.PT2)], this._symbol);
    this._shutDownArray.push(c);
    this._shutDownArray.push(a);
    c._map = this._map;
    a._map = this._map;
    c._setPath();
    a._setPath();
    DMap.$('#' + this.idPrefix).append(c.getDoms());
    DMap.$('#' + this.idPrefix).append(a.getDoms());
    this._dom = document.getElementById(this.idPrefix);
  },
  shutDown_getPoint: function (d, n, e, h, f, c) {
    var m;
    var j;
    if (e == Infinity) {
      m = 90;
    } else {
      if (e >= 0) {
        m = Math.atan(e);
      } else {
        m = 180 - Math.atan(e);
      }
    }
    if (d == 1) {
      j = f + m;
    } else {
      if (d == 2) {
        j = f + m;
      } else {
        if (d == 3) {
          j = f + m;
        } else {
          if (d == 4) {
            j = f + m - 180;
          } else {
            if (d == 5) {
              j = f;
            } else {
              if (d == 6) {
                j = f;
              } else {
                if (d == 7) {
                  j = f + 90;
                } else {
                  if (d == 8) {
                    j = f + 90;
                  }
                }
              }
            }
          }
        }
      }
    }
    var g = Math.tan(j);
    var i;
    if (g == Infinity) {
      i = n.x;
    } else {
      i = n.y - g * n.x;
    }
    var a = DMap.Util.getLinePointDistPoints(g, i, n, c);
    var l = {};
    l.PT1 = a[0];
    l.PT2 = a[1];
    l.K = g;
    l.B = i;
    return l;
  },
  redraw: function (b) {
    if (this.clipPath || b) {
      for (var a = 0; a < this._shutDownArray.length; a++) {
        this._shutDownArray[a]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._shutDownArray.length > 0) {
      for (var c = 0, b = this._shutDownArray.length; c < b; c++) {
        this._shutDownArray[c].setSymbol(this._symbol);
      }
    }
  },
  remove: function () {
    if (this._shutDownArray && this._shutDownArray.length > 0) {
      for (var a = 0; a < this._shutDownArray.length; a++) {
        this._map.removeOverlay(this._shutDownArray[a]);
      }
    }
    this._shutDownArray = [];
  },
  setLonLats: function (a) {
    this._shutDownArray = [];
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    if (this._editMarkerArray.length > 0) {
      for (var c = 0; c < this._editMarkerArray.length; c++) {
        this._editMarkerArray[c].remove();
        this._editMarkerArray[c] = null;
      }
      this._editMarkerArray = [];
    }
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.ShutDown(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.ShutDown'
});
DMap.ShutDown.clone = function (a) {
  return new DMap.ShutDown(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.ShutDown.printable = true;
DMap.Class('FireToAttack', DMap.Polyline, {
  idPrefix: null,
  _dom: null,
  _symbol: null,
  _lonlats: null,
  _fireToAttackArray: [],
  initialize: function (c, b, a) {
    DMap.EhlException.isTypeRight(c, 'undefined');
    DMap.EhlException._isArray(c);
    this._lonlats = c;
    this._symbol = DMap.$.extend(this.symbol, b);
  },
  draw: function (b) {
    this._map = b;
    if (!this.idPrefix) {
      this.idPrefix = DMap.Util.createUniqueID(this.CLASS_NAME);
      var a = document.getElementById(this._map._panelContainerId);
      a.appendChild(DMap.Util.createDiv({id: this.idPrefix, unselectable: 'on'}, {
        position: 'absolute',
        left: '0px',
        top: '0px',
        zIndex: '103'
      }));
    }
    this.getCurvePoints(this._lonlats);
  },
  redraw: function (b) {
    if (this.clipPath || b) {
      for (var a = 0; a < this._fireToAttackArray.length; a++) {
        this._fireToAttackArray[a]._setPath();
      }
      if (this._isEditing) {
        this.disableEditing();
        this.enableEditing();
      }
    }
  },
  getCurvePoints: function (points) {
    var _lonlat1 = points[0];
    var _lonlat2 = points[1];
    var peix1 = this._map.fromLonLatToDivPixel(_lonlat1);
    var peix2 = this._map.fromLonLatToDivPixel(_lonlat2);
    var peakPoints = new Array(16);
    var k = DMap.Util.getLineKX(peix1, peix2)[0];
    var l = DMap.Util.getLineKX(peix1, peix2)[1];
    var quadrant = DMap.Util.quadrant(_lonlat1, _lonlat2);
    var r = (parseFloat)(1 / 17) * DMap.Util.pointDistance(peix1, peix2);
    peakPoints[0] = this.getPoint_fireAttack(quadrant, peix1, k, l, r, true);
    var pt31 = DMap.Util.getLinePoint(k, l, peix1, peix2, 1 / 3);
    var pt32 = DMap.Util.getLinePoint(k, l, peix1, peix2, 2 / 3);
    peakPoints[1] = DMap.Util.getLinePoint(k, l, peix1, pt31, 1 / 6);
    peakPoints[2] = pt31;
    peakPoints[3] = DMap.Util.getLinePoint(k, l, pt31, pt32, 1 / 6);
    peakPoints[6] = DMap.Util.getLinePoint(k, l, pt31, pt32, 5 / 6);
    peakPoints[4] = DMap.Util.centerPoint(peakPoints[3], peakPoints[6]);
    peakPoints[5] = this.getPoint_fireAttack(quadrant, peakPoints[4], k, l, r, false);
    peakPoints[7] = pt32;
    peakPoints[8] = DMap.Util.getLinePoint(k, l, pt32, peix2, 5 / 6);
    peakPoints[9] = this.getPoint_fireAttack(quadrant, peix2, k, l, r, true);
    peakPoints[10] = this.getPoint_fireAttack(quadrant, peakPoints[7], k, l, r, true);
    var center = this.getPoint_fireAttack(quadrant, peakPoints[4], k, l, r, true);
    peakPoints[11] = this.getPoint_fireAttack(quadrant, peakPoints[2], k, l, r, true);
    var editPoint = null;
    if (this.getLonLats()[2] == undefined || this.getLonLats()[2] == null) {
      editPoint = (this.getPoint_fireAttack(quadrant, peakPoints[2], k, l, 8 * r, false));
    } else {
      editPoint = this._map.fromLonLatToDivPixel(this.getLonLats()[2]);
    }
    this._lonlats.push(this._map.fromDivPixelToLonLat(editPoint));
    peakPoints[12] = editPoint;
    peakPoints[15] = this.getPoint_fireAttack(quadrant, peakPoints[4], k, l, 3 * r, true);
    var kb1 = DMap.Util.getLineKX(peakPoints[12], peakPoints[2]);
    var pt61 = DMap.Util.getLinePoint(k, l, peakPoints[12], peakPoints[2], 1 / 6);
    var pts = DMap.Util.getPointToLineDistance(kb1[0], pt61, r);
    peakPoints[13] = pts[0];
    peakPoints[14] = pts[1];
    DMap.Polyline.prototype.initialize.call(this, [this._map.fromDivPixelToLonLat(peakPoints[0]), this._map.fromDivPixelToLonLat(peakPoints[1])]);
    var temp1 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[0]), this._map.fromDivPixelToLonLat(peakPoints[1])], this._symbol);
    var temp2 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[1]), this._map.fromDivPixelToLonLat(peakPoints[2])], this._symbol);
    var temp3 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[3]), this._map.fromDivPixelToLonLat(peakPoints[6])], this._symbol);
    var temp4 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[4]), this._map.fromDivPixelToLonLat(peakPoints[5])], this._symbol);
    var temp5 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[7]), this._map.fromDivPixelToLonLat(peakPoints[8])], this._symbol);
    var temp6 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[8]), this._map.fromDivPixelToLonLat(peakPoints[9])], this._symbol);
    var temp7 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[7]), this._map.fromDivPixelToLonLat(peakPoints[10])], this._symbol);
    var temp8 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[2]), this._map.fromDivPixelToLonLat(peakPoints[11])], this._symbol);
    var temp9 = new DMap.Polyline([this._map.fromDivPixelToLonLat(peakPoints[2]), this._map.fromDivPixelToLonLat(peakPoints[12])], this._symbol);
    var temp10 = new DMap.Polygon([this._map.fromDivPixelToLonLat(peakPoints[12]), this._map.fromDivPixelToLonLat(peakPoints[13]), this._map.fromDivPixelToLonLat(peakPoints[14]), this._map.fromDivPixelToLonLat(peakPoints[12])], this._symbol);
    var temp11 = new DMap.CurveLine([this._map.fromDivPixelToLonLat(peakPoints[11]), this._map.fromDivPixelToLonLat(peakPoints[15])], this._symbol);
    var temp12 = new DMap.CurveLine([this._map.fromDivPixelToLonLat(peakPoints[15]), this._map.fromDivPixelToLonLat(peakPoints[10])], this._symbol);
    for (var i = 1; i <= 12; i++) {
      var tt = eval('(temp' + i + ')');
      tt._map = this._map;
      tt._setPath();
      DMap.$('#' + this.idPrefix).append(tt.getDoms());
      this._fireToAttackArray.push(tt);
    }
    this._dom = document.getElementById(this.idPrefix);
  },
  setCommonEvent: function () {
    var a = this;
    a.clearEvent();
    this._dragObject = new DMap.DraggableObject(a._dom);
    DMap.$.extend(this._dragObject, {
      click: function (b) {
        DMap.$(a).trigger('click', [a._map.fromMouseEventToLonLat(b)]);
      }, drag: function (c, b) {
      }, dragend: function (b) {
      }
    });
    DMap.$(a._dom).bind('mouseenter', function (b) {
      DMap.$(a).trigger('mouseover');
      return false;
    }).bind('mouseleave', function (b) {
      DMap.$(a).trigger('mouseout');
      return false;
    }).bind('dblclick', function (b) {
      DMap.$(a).trigger('dblclick');
      return false;
    }).bind('contextmenu', function (b) {
      DMap.$(a).trigger('rightclick');
      return false;
    }).css('cursor', 'pointer');
    return this;
  },
  setSymbolForHold: function (a) {
    this._symbol = DMap.$.extend(this.symbol, a);
    if (this._fireToAttackArray.length > 0) {
      for (var c = 0, b = this._fireToAttackArray.length; c < b; c++) {
        this._fireToAttackArray[c].setSymbol(this._symbol);
      }
    }
  },
  getPoint_fireAttack: function (g, a, h, i, e, f) {
    var c = e;
    var j;
    var d = [];
    d = DMap.Util.getPointToLineDistance(h, a, c);
    if (g == 1) {
      if (DMap.Util.pointToLinePosition(d[0], h, i) < 0) {
        if (f) {
          j = d[0];
        } else {
          j = d[1];
        }
      } else {
        if (!f) {
          j = d[0];
        } else {
          j = d[1];
        }
      }
    } else {
      if (g == 2) {
        if (DMap.Util.pointToLinePosition(d[0], h, i) > 0) {
          if (f) {
            j = d[0];
          } else {
            j = d[1];
          }
        } else {
          if (!f) {
            j = d[0];
          } else {
            j = d[1];
          }
        }
      } else {
        if (g == 3) {
          if (DMap.Util.pointToLinePosition(d[0], h, i) > 0) {
            if (f) {
              j = d[0];
            } else {
              j = d[1];
            }
          } else {
            if (!f) {
              j = d[0];
            } else {
              j = d[1];
            }
          }
        } else {
          if (g == 4) {
            if (DMap.Util.pointToLinePosition(d[0], h, i) < 0) {
              if (f) {
                j = d[0];
              } else {
                j = d[1];
              }
            } else {
              if (!f) {
                j = d[0];
              } else {
                j = d[1];
              }
            }
          } else {
            if (g == 5) {
              if (DMap.Util.pointToLinePosition(d[0], h, i) < 0) {
                if (f) {
                  j = d[0];
                } else {
                  j = d[1];
                }
              } else {
                if (!f) {
                  j = d[0];
                } else {
                  j = d[1];
                }
              }
            } else {
              if (g == 8) {
                if (DMap.Util.pointToLinePosition(d[0], h, i) > 0) {
                  if (f) {
                    j = d[0];
                  } else {
                    j = d[1];
                  }
                } else {
                  if (!f) {
                    j = d[0];
                  } else {
                    j = d[1];
                  }
                }
              } else {
                if (g == 6) {
                  if (DMap.Util.pointToLinePosition(d[0], h, i) > 0) {
                    if (f) {
                      j = d[0];
                    } else {
                      j = d[1];
                    }
                  } else {
                    if (!f) {
                      j = d[0];
                    } else {
                      j = d[1];
                    }
                  }
                } else {
                  if (DMap.Util.pointToLinePosition(d[0], h, i) < 0) {
                    if (f) {
                      j = d[0];
                    } else {
                      j = d[1];
                    }
                  } else {
                    if (!f) {
                      j = d[0];
                    } else {
                      j = d[1];
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    return j;
  },
  remove: function () {
    if (this._fireToAttackArray && this._fireToAttackArray.length > 0) {
      for (var a = 0; a < this._fireToAttackArray.length; a++) {
        this._map.removeOverlay(this._fireToAttackArray[a]);
      }
    }
    this._fireToAttackArray = [];
  },
  setLonLats: function (a) {
    this._fireToAttackArray = [];
    this._lonlats = a;
    DMap.$('#' + this.idPrefix).empty();
    this.getCurvePoints(a);
  },
  getLonLats: function () {
    return this._lonlats;
  },
  enableEditing: function () {
    var e = this;
    if (this._isEditing) {
      return;
    } else {
      this._isEditing = true;
    }
    var f = function (g) {
      for (var h = 0; h < e._editMarkerArray.length; h++) {
        if (e._editMarkerArray[h].index == g) {
          return e._editMarkerArray[h];
        }
      }
    };
    var a = function (g) {
      e._lonlats[this.index] = this._lonlat;
      e.setLonLats(e._lonlats);
    };
    var d = function (i, h) {
      var g = new DMap.Marker(i, {
        type: 1,
        size: new DMap.Size(10, 10),
        offsetType: 'mm',
        opacity: 1
      }).setOpacity(parseInt(h) == h ? 1 : 0.5).setDragEvent();
      g.index = h;
      g.draw(e._map);
      e._editMarkerArray.push(g);
      DMap.$(g).bind('dragend', a);
    };
    if (this._editMarkerArray.length > 0) {
      for (var c = 0; c < this._editMarkerArray.length; c++) {
        this._editMarkerArray[c].remove();
        this._editMarkerArray[c] = null;
      }
      this._editMarkerArray = [];
    }
    for (var c = 0, b = this._lonlats.length; c < b; c++) {
      d(this._lonlats[c], c);
    }
  },
  disableEditing: function () {
    if (this._isEditing) {
      this._isEditing = false;
      DMap.$('#' + this._map._panelMarkerId).empty();
      for (var a = 0; a < this._editMarkerArray.length; a++) {
        this._editMarkerArray[a].remove();
        this._editMarkerArray[a] = null;
      }
      this._editMarkerArray = [];
    }
  },
  isEditing: function () {
    return this._isEditing;
  },
  copy: function () {
    return new DMap.FireToAttack(this.getLonLats(), this.getSymbol(), this.getAttributes());
  },
  CLASS_NAME: 'DMap.FireToAttack'
});
DMap.FireToAttack.clone = function (a) {
  return new DMap.FireToAttack(a.getLonLats(), a.getSymbol(), a.getAttributes());
};
DMap.FireToAttack.printable = true;
